Skip to content

Commit 21f91ba

Browse files
authored
Add files via upload
1 parent 3c4e26b commit 21f91ba

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Simple_Calculator.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
num1 = float(input("Enter first number:"))
2+
num2 = float(input("Enter Second number:"))
3+
operation = (input("Enter an operation:"))
4+
result = 0
5+
print("+ for Addition:")
6+
print("- for Subtraction:")
7+
print("/ for Division")
8+
print("* for Multiplication")
9+
if operation == '+':
10+
result = num1+num2
11+
print(result)
12+
elif operation == '-':
13+
result = num1-num2
14+
print(result)
15+
elif operation == '/':
16+
result = num1/num2
17+
print(result)
18+
else:
19+
result = num1*num2
20+
print(result)

0 commit comments

Comments
 (0)