Advertisement
adham-ahmed

Calculator in python!

Apr 17th, 2022
1,078
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.52 KB | None | 0 0
  1. print("""Operations:
  2. * : Multiplcations
  3. / : divide
  4. - :subctract
  5. + : add.""")
  6. operator = input("Please enter an operation: ")
  7. num1 = float(input("Please enter the first number: "))
  8. num2 = float(input("Please enter the first second: "))
  9. if operator == "*":
  10.     print("Result: ", num1 * num2)
  11. elif operator == "/":
  12.     print("Result: ", num1 / num2)
  13. elif operator == "-":
  14.     print("Result: ", num1 - num2)
  15. elif operator == "+":
  16.     print("Result: ", num1 + num2)
  17. else:
  18.     print("Invaild operator! please try again.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement