Advertisement
asweigart

zigzag.py

Jun 1st, 2019
281
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. # Press Ctrl-C to stop the program.
  2. import time
  3. indent = 0 # How many spaces to indent.
  4.  
  5. while True: # The main program loop.
  6.     for i in range(20):
  7.         indent = indent + 1
  8.         print(' ' * indent + '********')
  9.         time.sleep(0.05) # Pause for 50 milliseconds.
  10.  
  11.     for i in range(20):
  12.         indent = indent - 1
  13.         print(' ' * indent + '********')
  14.         time.sleep(0.05) # Pause for 50 milliseconds.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement