Hey guys so I am trying to read URLs from a file and print if the URLs exist/are reachable or not?? I am not sure why this code is not working: 
(I am reading the urls from a .txt file)

the error I am getting is:

```
   name 'in_file' is not defined

```

code:

```
from urllib.request import urlopen

def is_reachable(url):
   if urlopen(url): 
      return True
   else: 
      return False

in_file_name = input("Enter file name: ")
try:
   in_file = open(in_file_name, "r")
except:
   print("Cannot open " + in_file)

line = in_file.readline().replace(" ", "")
print(line)

counter = 0
while line != "":
  if is_reachable(line) == True:
    counter += 1
    print("The URL on line ", counter, "is unreachable!")
    line = in_file.readline()

```