Ask coding questions

← Back to all posts
How to Add Wait
LilWolfy (59)

Hi fellow Repl-ers!

I just wondered how to add a command in Python for a wait.
For example, the code prints something, then has a two second wait.

Please let me know if you know how.

First person who lets me know gets +5 cycles.

Answered by InvisibleOne (3226) [earned 5 cycles]
View Answer
Comments
hotnewtop
InvisibleOne (3226)

Just import time and then do time.sleep(time)

import time

print("Hello")

time.sleep(1) # will pause for one second

print("Hello")