Tags
python
Asked 2 years ago
16 Aug 2021
Views 285
Lila

Lila posted

How do you delay in Python 3 ?

How do you delay in Python 3?
fatso

fatso
answered Aug 16 '21 00:00

in Python 3 is the same code as Python 2 for delay,
below is the code for the delay in Python 3

import time
# 1 second delay
time.sleep(1) 

sleep function is used for the sleep code execution in seconds
sleep(s) where s is a parameter which is in seconds.
sleep is from the time package so you need to add import time and to invoke like below :
time.sleep(1) // for 1 second delay
time.sleep(10) // for 10 second delay
Post Answer