I know how to use geopy to convert a single address to GPS coordinates, but am having trouble with my code which should read addresses line by line from a file and convert each one to GPS coordinates and print them out.
from geopy.geocoders import Nominatim
geolocator = Nominatim()
f = open("FILE PATH")
line = f.readline()
for line in f.readlines():
address = line
location = geolocator.geocode(address)
print((location.latitude, location.longitude))
f.close()