File tree Expand file tree Collapse file tree 1 file changed +21
-8
lines changed
100-Days-Projects/Days 1-3-Datetimes Expand file tree Collapse file tree 1 file changed +21
-8
lines changed Original file line number Diff line number Diff line change @@ -8,22 +8,35 @@ def countdown(t):
8
8
timeformat = '{:02d}:{:02d}' .format (mins , secs )
9
9
print (timeformat , end = '\r ' )
10
10
time .sleep (60 )
11
+ #time.sleep(1) #for testing
11
12
t -= 1
12
-
13
+ count = 0
13
14
now = datetime .now ()
14
- nowPlusOne = now + timedelta (minutes = 25 )
15
+ nowPlus25 = now + timedelta (minutes = 25 )
15
16
16
17
nowMinute = now .minute
17
- nowPlusOneMin = nowPlusOne .minute
18
+ nowPlus25Min = nowPlus25 .minute
18
19
19
- while (nowMinute != nowPlusOneMin ):
20
+ while count <= 4 :
21
+ while (nowMinute != nowPlus25Min ):
22
+ print ("Break time will be at: " + str (nowPlus25 ))
23
+ countdown (25 )
20
24
time .sleep (1 )
21
25
now = datetime .now ()
22
26
nowMinute = now .minute
23
- print ("Break time will be at: " + str (nowPlusOne ))
24
- countdown (25 )
25
-
27
+ # if nowMinute == nowPlus25Min:
28
+ # break
26
29
30
+ print ("Take a break!" )
27
31
28
- print ("Take a break!" )
32
+ now = datetime .now ()
33
+ nowPlusFive = now + timedelta (minutes = 5 )
34
+ nowPlusFiveMin = nowPlusFive .minute
29
35
36
+ while (nowMinute != nowPlusFiveMin ):
37
+ print ("Work timer will start at: " + str (nowPlusFive ))
38
+ countdown (5 )
39
+ time .sleep (1 )
40
+ now = datetime .now ()
41
+ nowMinute = now .minute
42
+ count += 1
You can’t perform that action at this time.
0 commit comments