watermark logo

تا بعدی

پخش خودکار

Python calculator program 🧮

0 بازدیدها • 10/30/24
اشتراک گذاری
جاسازی کنید
121gamers
121gamers
14 مشترکین
14

#python #tutorial #code

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

بیشتر نشان بده، اطلاعات بیشتر
0 نظرات sort مرتب سازی بر اساس
نظرات فیس بوک

تا بعدی

پخش خودکار