Python calculator program đ§Ž
0 āĻāĻŋāĻ
âĸ 10/30/24
0
0
āĻŦāϏāĻžāύ
121gamers
14 āϏāĻžāĻŦāϏā§āĻā§āϰāĻžāĻāĻŦāĻžāϰ
#python #tutorial #code
operator = input("Enter an operator (+ - * /): ")
num1 = float(input("Enter the 1st number: "))
num2 = float(input("Enter the 2nd number: "))
if operator == "+":
result = num1 + num2
print(round(result, 3))
elif operator == "-":
result = num1 - num2
print(round(result, 3))
elif operator == "*":
result = num1 * num2
print(round(result, 3))
elif operator == "/":
result = num1 / num2
print(round(result, 3))
else:
print(f"{operator} is not a valid operator")
āĻāϰ⧠āĻĻā§āĻā§āύ
āĻĢā§āϏāĻŦā§āĻ āĻŽāύā§āϤāĻŦā§āϝ
SORT BY-
āĻļā§āϰā§āώ āĻŽāύā§āϤāĻŦā§āϝ
-
āϏāϰā§āĻŦāĻļā§āώ āĻŽāύā§āϤāĻŦā§āϝ