import requests


def connected_internet() -> bool:
    """ Checks if program is connected to the internet """
    url = "http://www.google.com"
    timeout = 5
    try:
        requests.get(url, timeout=timeout)
        return True
    except (requests.ConnectionError, requests.Timeout):
        print("\nError: No internet connection!\n")
        return False