Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sun Angle by rudnytskyi2007
from typing import Union
def sun_angle(time: str) -> Union[float, str]:
h, m = map(int, time.split(':'))
g = (h - 6) * 15 + (m / 60) * 15
return g if g >= 0 and g <= 180 else "I don't see the sun!"
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!")
May 7, 2023