Let's code a simple python CALCULATOR! 🧮

Published: 13 August 2024
on channel: Bro Code
29,188
591

#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")


Watch video Let's code a simple python CALCULATOR! 🧮 online without registration, duration hours minute second in high quality. This video was added by user Bro Code 13 August 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 29,188 once and liked it 591 people.