Lets code a simple python calculator! 🧮 @BroCodez
Lets code a simple python calculator! 🧮  @BroCodez
Uploaded August 2024 | Updated November 2026, 1 hour ago
#python #pythontutorial #pythoncourse

# Python calculator
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")
Lets code a simple python calculator! 🧮MongoDB collections explainedLearn C for loops in 6 minutes! 🔂
Bro Code |

Let's code a simple python calculator! 🧮

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER