Slowly display text with spaces in between each letter and lowercase letter i's.
(text, interval=0.1)
| 7 | |
| 8 | |
| 9 | def 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: |