I want it to run the first line print 1 then wait 1 second to run the second command print 2, etc.
Pseudo-code:
print 1
wait(1 seconds)
print 2
wait(0.45 seconds)
print 3
wait(3 seconds)
print 4
Python time sleep function is used to add delay in the execution of a program. We can use python sleep function to halt the execution of the program for given time in seconds.
time.sleep(seconds)
import time
print 1
time.sleep(1)
print 2
time.sleep(0.45)
print 3
time.sleep(3)
print 4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With