Guest User

Untitled

a guest
Oct 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1.  
  2.  
  3. choice = 0
  4. looping = True
  5.  
  6. while looping == True:
  7. print ("Welcome to calculator.py")
  8. print ("1) Addition")
  9. print ("2) Subtraction")
  10. print ("3) Multiplication")
  11. print ("4) Division")
  12. print ("5) Exit")
  13. print (" ")
  14. choice = int(input("what is your choice: "))
  15. if choice == 1:
  16. test = 'lol'
  17. add1 = int(input("this: "))
  18. add2 = int(input("this: "))
  19. print(add1+add2)
  20. elif choice == 2:
  21. sub2 = int(input("Subtract this: "))
  22. sub1 = int(input("from this: "))
  23. print (sub1, "-", sub2, "=",sub1 - sub2)
  24. elif choice == 3:
  25. mul1 = int(input("Multiply this: "))
  26. mul2 = int(input("with this: "))
  27. print (mul1,"*",mul2,"=",mul1 * mul2)
  28. elif choice == 4:
  29. div1 = int(input("Divide this: "))
  30. div2 = int(input("by this: "))
  31. print(div1,"/",div2,"=",div1 / div2)
  32. elif choice == 5:
  33. looping = False
  34. print("Goodbye")
Add Comment
Please, Sign In to add comment