def check_internet():
 try:
  urlopen('https://github.com')
 except URLError as err:
  return False
 return True

def check_internet ( ) : try : urlopen ( 'https://github.com' ) except URLError as err : return False return True
check if internet is available .