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
Math,
6 months ago
Geography,
6 months ago
English,
6 months ago
Computer Science,
11 months ago
Computer Science,
11 months ago
Math,
1 year ago
Physics,
1 year ago