Let's code a simple python calculator! 🧮

Опубликовано: 13 Август 2024
на канале: Bro Code
84,395
1.3k

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


На этой странице сайта вы можете посмотреть видео онлайн Let's code a simple python calculator! 🧮 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь Bro Code 13 Август 2024, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 84,395 раз и оно понравилось 1.3 тысяч зрителям. Приятного просмотра!