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, duration hours minute second in high quality that is uploaded to the channel Bro Code 13 August 2024. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 29,188 times and liked it 591 visitors.