PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
print ("*.English:")
print ("*.Welcome to the calculator:")
print ("*.Follow the instructions to avoid making mistakes")
print ("*.Instructions:")
print ("1.Press RUN")
print ("2.Select the operation you want to perform (addition, subtraction, multiplication, division):")
print ("_ If you want to add, write (addition) ")
print ("_ If you want to subtract, write (subtraction) ")
print ("_ If you want to multiply, write (multiplication) ")
print ("_ If you want to divide, write (division) ")
print ("3.Then leave a line")
print ("4.Write the first number, then leave a line and write the second number to perform the operation")
print ("_ In division, you cannot divide by 0 ")
print ("5.Press SUBMIT to display the result")
print ("*.Operation:")
operation = input().strip().lower()
if operation == "addition" or operation == "add":
number1 = float(input())
print(number1)
print("+")
number2 = float(input())
print(number2)
total = number1 + number2
print("______")
print ("=", total)
print(f"The result is: {total}")
elif operation == "subtraction" or operation == "subtract":
number1 = float(input())
Enter to Rename, Shift+Enter to Preview
OUTPUT
Exécuter