Short breaks can be fun and functional in some programs. Creating a waiting time before displaying a text, for example, can make the process of using that program more real.
For that, let's import the sleep()
method from the time
module:
from time import sleep
And now just call the sleep()
method specifying the time in seconds:
# 3 second delay
sleep(3)
# 1 minute delay
sleep(60)
Example of how delays can make a program more real:
print('Jo')
sleep(1)
print('Ken')
sleep(1)
print('Po')
sleep(1)
Top comments (0)