I'm trying to get it to print the question out, letter by letter, all in the same line.
import sys import time def typing(msg): for z in msg: time.sleep(0.04) sys.stdout.write(z) sys.stdout.flush() input(typing('What is your name? '))
output: What is your name?None
What is your name?None
You need to change the order of input and typing:
import sys import time def typing(msg): for z in msg: time.sleep(0.04) sys.stdout.write(z) sys.stdout.flush() typing(input())
2.1m questions
2.1m answers
60 comments
57.0k users