Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- num1 = input("Enter the first number: ")
- num2 = input("Enter the second number: ")
- math_operation = input("Enter the operation you want to perform: ")
- if math_operation == "+":
- print(f"{num1} + {num2} = {float(num1) + float(num2)}")
- elif math_operation == "-":
- print(f"{num1} - {num2} = {float(num1) - float(num2)}")
- elif math_operation == "*":
- print(f"{num1} * {num2} = {float(num1) * float(num2)}")
- elif math_operation == "/":
- print(f"{num1} / {num2} = {float(num1) / float(num2)}")
- else:
- print("Invalid operation")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement