MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / slowSpacePrint

Function slowSpacePrint

src/gamesbyexample/magicfortuneball.py:9–21  ·  view source on GitHub ↗

Slowly display text with spaces in between each letter and lowercase letter i's.

(text, interval=0.1)

Source from the content-addressed store, hash-verified

7
8
9def slowSpacePrint(text, interval=0.1):
10 """Slowly display text with spaces in between each letter and
11 lowercase letter i's."""
12 for character in text:
13 if character == 'I':
14 # I's are displayed in lowercase for style:
15 print('i ', end='', flush=True)
16 else:
17 # All other characters are displayed normally:
18 print(character + ' ', end='', flush=True)
19 time.sleep(interval)
20 print() # Print two newlines at the end.
21 print()
22
23
24# Prompt for a question:

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected