آلة حاسبة بلغة بايثون Calculator in python language

تفاصيل العمل

.I made a program in python that makes a calculator and I want to share the code with you

لقد صنعت برنامج بالبايثون يصنع آلة حاسبة وأريد مشاركة الكود معكم.

try:

n1 = float(input("Please, Insert the first number\n"))

n2 = float(input("Please, Insert the second number\n"))

operation = input("Please, Insert the operation you want to perform(+,-,*,/,power)\n")

if operation == "+":

print("Result is: ", n1 + n2)

elif operation == "-":

print("Result is: ", n1 - n2)

elif operation == "*":

print("Result is: ", n1 * n2)

elif operation == "/":

print("Result is: ", n1 / n2)

elif operation == "power":

print("Result is: ", n1 ** n2)

else:

print("We don't support this operation, supported opearatons are: (+,-,*,/,power)")

except ValueError:

print("Please, Insert a number not a text.")

بطاقة العمل

اسم المستقل
عدد الإعجابات
0
عدد المشاهدات
497
تاريخ الإضافة
تاريخ الإنجاز
المهارات