Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python count down advanced

import time

def countdown(time_sec):
    while time_sec:
        mins, secs = divmod(time_sec, 60)
        timeformat = '{:02d}:{:02d}'.format(mins, secs)
        print(timeformat, end='
')
        time.sleep(1)
        time_sec -= 1

    print("stop")

countdown(5)
Source by www.programiz.com #
 
PREVIOUS NEXT
Tagged: #python #count #advanced
ADD COMMENT
Topic
Name
7+9 =