Advertisement
silver2row

lesson learned on Python and the inevitable!

Aug 15th, 2020
2,170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.73 KB | None | 0 0
  1. account1 = 0
  2. account2 = 0
  3.  
  4. while True:
  5.     try:
  6.         account1 = int(input("Please input a number from 0 to 180: "))
  7.         for i in range(0, 180, 10):
  8.             motor1.set(-5)
  9.             sleep(4)
  10.             motor1.set(0)
  11.             sleep(4)
  12.             print("You just typed: ", motor1)
  13.  
  14.     except KeyboardInterrupt:
  15.         print("The expressions are over!")
  16.  
  17.     try:
  18.         account2 = int(input("Please choose another number in between 0 and 180: "))
  19.         for a in range(0, 180, 25):
  20.             motor1.set(a)
  21.             sleep(4)
  22.             motor1.set(-5)
  23.             sleep(4)
  24.             motor1.set(0)
  25.             sleep(4)
  26.  
  27.     except KeyboardInterrupt:
  28.         print("You are done w/ the program. Yea!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement