We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9786701 commit d504e70Copy full SHA for d504e70
52/gwenllian1136/Pomodoro.py
@@ -0,0 +1,21 @@
1
+# countdown alarm
2
+# set a time e.g. 20 minutes, counts down and then alarm
3
+
4
+from datetime import datetime
5
+from datetime import timedelta
6
+import time
7
8
+counter_str=input("How many mins to you want to count down ?")
9
+counter=int(counter_str)
10
11
+if counter<=0:
12
+ counter=1
13
+now_time=datetime.today()
14
+the_gap=timedelta(minutes=counter)
15
+Alarm_time=now_time+the_gap
16
17
+print('Start time is '+datetime.now().strftime('%H:%M:%S'))
18
+while datetime.now()<Alarm_time:
19
+ time.sleep(1)
20
21
+print('It''s '+ Alarm_time.strftime('%H:%M:%S')+ '. Please Stop!')
challenges
@@ -0,0 +1 @@
+Subproject commit 9786701d6597f9370304926e1a6a45266549069c
0 commit comments