Advertisement
KodingKid

Python 2-Number Calculator for Adding, Subtracting, Dividing, and Multiplying

Jul 31st, 2021
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. print("Two number calculator")
  2. print("Please enter two numbers to add, multiply, divide, or subtract")
  3. number1 == input("Number 1")
  4. number2 == input("Number 2")
  5. print("Would you like to add, multiply, divide, or subtract?")
  6. answer == input()
  7. if answer == "add" or "Add":
  8.     print(number1 + number2)
  9. if answer == "multiply" or "Multiply":
  10.     print(number1 * number2)
  11. if answer == "divide" or "Divide":
  12.     print(number1 / number2)
  13. if answer == "subtract" or "Subtract":
  14.     print(number1 - number2)
  15. else:
  16.     print("Please try again")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement