-1
import time as t
def main():
    a = "hello word"
    for i in a:
        t.sleep(0.1)
        print(i,end=" ")
       
main()      

prints each word without stopping the code

Pranav Hosangadi
  • 23,755
  • 7
  • 44
  • 70
  • This may help you. [How do I make a time delay?](https://stackoverflow.com/questions/510348/how-do-i-make-a-time-delay) – randhana Jan 04 '23 at 17:21
  • Does this answer your question? [Typing effect in Python](https://stackoverflow.com/questions/20302331/typing-effect-in-python) – Pranav Hosangadi Jan 04 '23 at 17:21

1 Answers1

2

use flush:

print(i, end=" ", flush=True)
Marco F.
  • 432
  • 1
  • 10