Skip to content

Conversation

subh6678
Copy link

No description provided.

Comment on lines +2 to +6





Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary empty spaces

def countdown(time_sec):
while time_sec:
mins, secs = divmod(time_sec, 60)
timeformat = '{:02d}:{:02d}'.format(mins, secs)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.format was popular in python 2.x, if you want you can do the same with f string.

timeformat = f'{mins:02d}:{secs:02d}'

time.sleep(1)
time_sec -= 1

print("stop")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"stop" can be replaced with "countdown ended".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants