Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sun Angle by Orthomonalus
from typing import Union
def sun_angle(time: str) -> Union[float, str]:
# replace this for solution
(h, m) = time.split(':')
angle = 15 * int(h) + int(m) * 0.25 - 90
return "I don't see the sun!" if angle < 0 or angle > 180 else round(angle,2)
print("Example:")
print(sun_angle("07:00"))
assert sun_angle("07:00") == 15
assert sun_angle("12:15") == 93.75
print("The mission is done! Click 'Check Solution' to earn rewards!")
Oct. 22, 2024
Comments: