lat=int(input('Enter the latitude:'))
if lat>90 or lat<-90:
print("ERROR Please enter a valid latitude")
lat=int(input('Enter the latitude:'))
if lat==0:
print("That location is on the equator.")
elif lat>0 and lat<90:
print("That location is north of the equator.")
elif lat>-90 and lat<0:
print("That location is south of the equator.")
lon=int(input('Enter the longitude:'))
if lon>180 or lon<-180:
print("ERROR Please enter a valid longitude")
lon=int(input('Enter the longitude:'))
if lon==0:
print("That location is on the prime meridian.")
elif lon>0 and lon<180:
print("That location is east of the prime meridian.")
elif lon>-180 and lon<0:
print("That location is west of the prime meridian.")
To see this working, head to your live site.
Search
Aug 08, 2019
For given latitude value check the location on equator in python
For given latitude value check the location on equator in python
0 comments
0