Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Sun Angle by trang_a2k100
from typing import Union
def sun_angle(time: str) -> Union[float, str]:
time = time.split(":")
angle = (int(time[0]) * 60 + int(time[1]) - 6 * 60) * 0.25
if angle <= 180 and angle >= 0:
return angle
return "I don't see the sun!"
print("Example:")
print(sun_angle("05: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 12, 2023