My question is about input functions in python 3 specifically for a latitude conversion function from dms to dd.
I'm new to python3 and having some trouble understanding how I would allow a user to input their latitude DMS coordinate and have them limited by a 0-90 range, so if they put something like 100, or -1, the code would return a statement asking them to input a valid latitude DMS format.
Below is my code - I think my if statement is where the trouble is happening. When I'm indicating if variable(x,x,x) - would that indicate the format the user would need to input their coordinate in?
def dmslat_convert_to_dd(degrees, minutes, seconds): dd = degrees + float(minutes) / 60 + float(seconds) / 3600 return dd dmslat = input('Please enter your DMS coordinate for Latitude: ') if dmslat_convert_to_dd(degrees, minutes, seconds) in range(0, 90): print(dd) else: print("Please enter correct DMS Latitude coordinates")