Ask coding questions

← Back to all posts
I need help slowing down a python loop
ia13ru (43)

I am makin this game. I want to slow down the 'for i in range(3) ' loop in ' if key==""'. How do I do this?

Coder100 (18185)

you could use time.sleep to make it wait.
don't forget to also add import time

ia13ru (43)

@Coder100 Where? I am also using tkinter

Saml2020 (51)

@ia13ru time.sleep() Pauses the whole program. So if you want to slow down a loop, put it at the end or start inside of the loop.

Coder100 (18185)

inside the loop!

while ...:


ruiwenge2 (595)

you can use this:

import time

# insert code here

You can change the 1 to however many seconds you would like.

ch1ck3n (2065)

Can you be more descriptive