Let's code a simple python CALCULATOR! 🧮

Опубликовано: 13 Август 2024
на канале: 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")


Смотрите видео Let's code a simple python CALCULATOR! 🧮 онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь Bro Code 13 Август 2024, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 29,188 раз и оно понравилось 591 людям.