I'm trying to make a program that prints words one letter at a time, but with a pause in between each letter. I found a function called sleep that should help. I'm using the sleep function for that, but it first waits, then prints the text, instead of how I want it. Here's my code:
from time import sleep
firstline = "Hello!"
for i in range(len(firstline)):
print(firstline[i], end = "")
sleep(1)
It should print each letter of Hello! with a 1 second pause in between the letters. But it just waits six seconds, then prints it all at once. I'm new to python, so if you find a bug in my code, please tell me. Thanks.