My function is
def validate_latitude(lat):
"""Enforce latitude is in range
>>> validate_latitude(65)
65
>>> validate_latitude(91)
90
>>> validate_latitude(-91)
-90
"""
lat = min(lat, 90)
lat = max(lat, -90)
return lat
And the test fails with this output
**********************************************************************
File "packages/utils.py", line 64, in __main__.validate_latitude
Failed example:
validate_latitude(-91)
Expected:
-90
Got:
-90
**********************************************************************
Cant see why it fails in spite of having the deisred output