Getting an Error while print the first code-Pls help

Hello Everyone,

I just started learning Python, I wrote a small code but always getting an error like:
print (ip)
NameError: name ‘ip’ is not defined

from geoip import geolite2

ip = “172.67.74.185”

locator = geolite2.lookup(ip)

print (locator)

I would guess that you put the print(ip) before the ip="…". In
Python names do not exist before they are defined.

Cheers,
Cameron Simpson cs@cskk.id.au