Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python counting up and down

from time import sleep, time

can_run = True
the_number = 0

end_number = 11 #you can change the number to be last counted

while can_run:
    print(the_number)
    sleep(1)
    the_number = the_number + 1
    if  the_number == end_number: 
        can_run = False
        can_walk = True
        end_number = 0
        while can_walk:
            the_number = the_number - 1
            print(the_number)
            sleep(1)
            if the_number == end_number:
                can_walk = False
Comment

PREVIOUS NEXT
Code Example
Python :: search mean in python using pandas 
Python :: us states and capitals dictionary 
Python :: python dict to string 
Python :: mistborn books 
Python :: python string formatting - padding 
Python :: making your own range function with step in python 
Python :: tkinter insert value box 
Python :: how to omit days pandas datetime 
Python :: how to find out the max and min date on the basis of property id in pandas 
Python :: python get output 
Python :: warnings.warn("DateTimeField %s received a naive datetime (%s)" 
Python :: python radiobutton default value 
Python :: how to set environment variable in pycharm 
Python :: How to remove case sensitive django filter 
Python :: model.predict knn 
Python :: python compare dates 
Python :: migrations.RunPython 
Python :: list.add in python 
Python :: tkinter auto resize height 
Python :: python check if string contains one of characters list 
Python :: find the difference of strings in python 
Python :: Django - Knox auth setup 
Python :: var colors python 
Python :: circle python programe 
Python :: csrf token django 
Python :: python iterating over a list 
Python :: switch case python 3.10 
Python :: save set of numpy arrays to file py 
Python :: sqlite python select with parameters 
Python :: pandas assign multiple columns at once 
ADD CONTENT
Topic
Content
Source link
Name
7+2 =