How can I make a time delay in Python?
Answers
Answered by
0
It's Simple AF. Just follow.
You have to install time module
and you're done.
.
.
.
from time import sleep
#you can delay by passing seconds as args to sleep function.
sleep(2)
#means will delay for 2 sec.
Example:-
for i in range(1,60):
sleep(1)
print(i)
# this will print value of 'i' after every second.
You have to install time module
and you're done.
.
.
.
from time import sleep
#you can delay by passing seconds as args to sleep function.
sleep(2)
#means will delay for 2 sec.
Example:-
for i in range(1,60):
sleep(1)
print(i)
# this will print value of 'i' after every second.
Similar questions