+ 1
Code executed after time
I want to make a statement end with â. . .â (Example: print(âLetâs play a game(dot)wait(dot)wait(dot)â)But have each dot wait a second before appearing, to give the program a little bit of life. How would I go about doing this? I tried using sleep but it doesnât work for me.
3 Answers
+ 2
import time
print("The statement you want to output", end='')
for x in range(3):
print('.', end='')
time.sleep(1)
# or you can swap the two line in the 'for' loop around.
+ 1
have a look at the time module, sleep is in there.
0
rodwynnejones When I try time.sleep(1),â.â,
time.sleep(1),â.â, time.sleep(1),â.â
It prints out âNone . None . None .â
What am I doing wrong?