Skip to content

Commit d588b46

Browse files
committed
Cleanup the data comparison
1 parent fe21217 commit d588b46

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

  • PyPortal_Halloween_Countdown

PyPortal_Halloween_Countdown/code.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,15 +103,8 @@
103103
pyportal.set_caption('', (13, 215), 0x000000)
104104
while True: # that's all folks
105105
pass
106-
secs_remaining = remaining % 60
107-
remaining //= 60
108-
mins_remaining = remaining % 60
109-
remaining //= 60
110-
hours_remaining = remaining % 24
111-
remaining //= 24
112-
days_remaining = remaining
113-
print("%d days, %d hours, %d minutes and %s seconds" %
114-
(days_remaining, hours_remaining, mins_remaining, secs_remaining))
106+
days_remaining = remaining // 86400
107+
print("%d days remaining" % (days_remaining))
115108
countdown_text.text = '{:>3}'.format(days_remaining)
116109
pyportal.set_background(backgrounds[random.randint(0, 17)])
117110

0 commit comments

Comments
 (0)