Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- choice = 0
- looping = True
- while looping == True:
- print ("Welcome to calculator.py")
- print ("1) Addition")
- print ("2) Subtraction")
- print ("3) Multiplication")
- print ("4) Division")
- print ("5) Exit")
- print (" ")
- choice = int(input("what is your choice: "))
- if choice == 1:
- test = 'lol'
- add1 = int(input("this: "))
- add2 = int(input("this: "))
- print(add1+add2)
- elif choice == 2:
- sub2 = int(input("Subtract this: "))
- sub1 = int(input("from this: "))
- print (sub1, "-", sub2, "=",sub1 - sub2)
- elif choice == 3:
- mul1 = int(input("Multiply this: "))
- mul2 = int(input("with this: "))
- print (mul1,"*",mul2,"=",mul1 * mul2)
- elif choice == 4:
- div1 = int(input("Divide this: "))
- div2 = int(input("by this: "))
- print(div1,"/",div2,"=",div1 / div2)
- elif choice == 5:
- looping = False
- print("Goodbye")
Add Comment
Please, Sign In to add comment