Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- print("Welcome to Calculator v1.1")
- print(" A)Addition")
- print(" B)Subtraction")
- print(" C)Multiplication")
- print(" D)Division")
- print(" E)Press Enter to Exit")
- choice = raw_input("Pick your calculation: ")
- Loop = "True"
- while True:
- if choice == "A":
- X = input("Enter the first number: ")
- Y = input("Enter the second number: ")
- print("Your answer is: " + str(X+Y))
- print(" A)Addition")
- print(" B)Subtraction")
- print(" C)Multiplication")
- print(" D)Division")
- print(" E)Press Enter to Exit")
- choice = raw_input("Pick your calculation: ")
- if choice == "B":
- X = input("Enter the first number: ")
- Y = input("Enter the second number: ")
- print("Your answer is: " + str(X-Y))
- print(" A)Addition")
- print(" B)Subtraction")
- print(" C)Multiplication")
- print(" D)Division")
- print(" E)Press Enter to Exit")
- choice = raw_input("Pick your calculation: ")
- if choice == "C":
- X = input("Enter the first number: ")
- Y = input("Enter the second number: ")
- print("Your answer is: " + str(X*Y))
- print(" A)Addition")
- print(" B)Subtraction")
- print(" C)Multiplication")
- print(" D)Division")
- print(" E)Press Enter to Exit")
- choice = raw_input("Pick your calculation: ")
- if choice == "D":
- X = input("Enter the first number: ")
- Y = input("Enter the second number: ")
- print("Your answer is: " + str(X/Y))
- print(" A)Addition")
- print(" B)Subtraction")
- print(" C)Multiplication")
- print(" D)Division")
- print(" E)Press Enter to Exit")
- choice = raw_input("Pick your calculation: ")
- if choice == "E":
- break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement