Here is my code which returns the timezone a set of coordinates are in. The IDE is telling me that a colon is expected somewhere in the nested if statement. The first if statement seems to be fine. and when I take out the negative signs in the other if statements they work fine. Thanks for any help!
def findTimeZone(coordinatesString):
coordinates = coordinatesString.split(",")
if 24.660845 <= float(coordinates[0]) <= 49.189787:
if ‐87.518395 <= float(coordinates[1]) < ‐67.44457:
return "eastern"
elif ‐87.518395 <= float(coordinates[1]) < ‐101.998892:
return "central"
elif ‐101.998892 <= float(coordinates[1]) < ‐115.236428:
return "mountain"
elif ‐115.236428 <= float(coordinates[1]) <= ‐125.242264:
return "pacific"
I could just assign each float to a variable but I would like to know why this is causing an error, Thanks.
-manually in python IDLE.