We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 39a388e commit 5b0c95eCopy full SHA for 5b0c95e
1 file changed
checkio/sun_angle.py
@@ -0,0 +1,17 @@
1
+def sun_angle(time):
2
+ s=time.split(":")
3
+ a=int(s[0])*60+int(s[1])
4
+ if a>(18*60) or a<(6*60):
5
+ return "I don't see the sun!"
6
+ else:
7
+ angle=(a-6*60)*0.25
8
+ return angle
9
+
10
+if __name__ == '__main__':
11
+ print("Example:")
12
+ print(sun_angle("07:00"))
13
14
+ #These "asserts" using only for self-checking and not necessary for auto-testing
15
+ assert sun_angle("07:00") == 15
16
+ assert sun_angle("01:23") == "I don't see the sun!"
17
+ print("Coding complete? Click 'Check' to earn cool rewards!")
0 commit comments