Advertisement
Guest User

Untitled

a guest
Apr 7th, 2020
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.63 KB | None | 0 0
  1. import time
  2. indent = 0 # How many spaces to indent.
  3. indentIncreasing = True # Whether the indentation is increasing or not.
  4. while True: # The main program loop.
  5.     print(' ' * indent, end='')
  6.     print('********')
  7.     time.sleep(0.1) # Pause for 1/10 of a second.
  8.     if indentIncreasing:
  9.         # Increase the number of spaces:
  10.         indent = indent + 1
  11.         if indent == 20:
  12.             # Change direction:
  13.             indentIncreasing = False
  14.     else:
  15.         # Decrease the number of spaces:
  16.         indent = indent - 1
  17.         if indent == 0:
  18.             # Change direction:
  19.             indentIncreasing = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement