Advertisement
kingbode

Untitled

Aug 7th, 2024
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.46 KB | None | 0 0
  1.  
  2.  
  3. num1 = input("Enter the first number: ")
  4. num2 = input("Enter the second number: ")
  5.  
  6. math_operation = input("Enter the operation you want to perform: ")
  7.  
  8. if math_operation == "+":
  9.     print(float(num1) + float(num2))
  10. elif math_operation == "-":
  11.     print(float(num1) - float(num2))
  12. elif math_operation == "*":
  13.     print(float(num1) * float(num2))
  14. elif math_operation == "/":
  15.     print(float(num1) / float(num2))
  16.  
  17. else:
  18.     print("Invalid operation")
  19.  
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement