I want to make such program which reads characters from a string and prints each character after some delay so its look like typing effect.
Now my problem is sleep f
Long Answer:
import sys
import time
variable_name = 'Words'
for char in variable_name:
time.sleep(0)
sys.stdout.write(char)
Why do you need the flush method? My code works without it.
Short Answer:
import time
variable_name = 'Words'
for char in variable_name:
time.sleep(0)
print(char, end = '')
If you want the words to print vertically, then you should leave out the end argument.
If you want the words to print horizontally, then you should use the end argument.
Either way, the code works without the flush method.