+ 1

Python: How to make each letter typed out 1 by 1.

How would I make a word spelled out. For example if I have a print function where it says... print("Hello world") I can make it spell it out from left to right. It would print "Hello world" still but it would type it out in Python so it wouldn't just be a static print. Is it built in or would I need to import a module for it? Would I need to create a visual for this or can it be done with just a basic text-writer like pycharm?

17th Nov 2019, 12:25 AM
Sean Brown
Sean Brown - avatar
5 odpowiedzi
+ 7
import time for letter in "Hello world": print(letter) time.sleep(0.5) for letter in "Hello world": print(letter, end="") time.sleep(0.5) https://docs.python.org/3/library/time.html#time.sleep
17th Nov 2019, 1:20 AM
Diego
Diego - avatar
+ 3
How do you mean it? Do you just want to write each letter separately, like a space apart? Or one by one after a time interval? Or what exactly?
17th Nov 2019, 12:51 AM
HonFu
HonFu - avatar
+ 2
Thanks works great! Diego
17th Nov 2019, 4:16 AM
Sean Brown
Sean Brown - avatar
0
One after a time interval. HonFu
17th Nov 2019, 12:56 AM
Sean Brown
Sean Brown - avatar
0
Deigo, Thanks so much! This is AMAZING.
11th Nov 2024, 8:58 PM
Luke