Created
April 18, 2020 13:54
-
-
Save abhi923/7f9d9aa5f2291dc0c06ac08ca68d41c9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time, sys | |
indent = 0 # How many spaces to indent. | |
indentIncreasing = True # Whether the indentation is increasing or not. | |
try: | |
while True: # The main program loop. | |
print(' ' * indent, end='') | |
print('* ******** *') | |
time.sleep(0.1) # Pause for 1/10 of a second. | |
if indentIncreasing: | |
# Increase the number of spaces: | |
indent = indent + 1 | |
if indent == 40: | |
# Change direction: | |
indentIncreasing = False | |
else: | |
# Decrease the number of spaces: | |
indent = indent - 5 | |
if indent == 5: | |
# Change direction: | |
indentIncreasing = True | |
except KeyboardInterrupt: | |
sys.exit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment