Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit 94f0a7c

Browse files
authored
Merge pull request #87 from ritiksoni00/master
SImple_calculator
2 parents f409b76 + f54349f commit 94f0a7c

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

Scripts/Simple_calculator.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
operation = input('''
2+
Please type in the math operation you would like to complete:
3+
1 for addition
4+
2 for subtraction
5+
3 for multiplication
6+
4 for division
7+
''')
8+
9+
num = int(input('Enter your first number: '))
10+
num2 = int(input('Enter your second number: '))
11+
12+
if operation == '1':
13+
print('{} + {} = '.format(num, num2))
14+
print(num+num2)
15+
16+
elif operation == '2':
17+
print('{} - {} = '.format(num, num2))
18+
print(num-num2)
19+
20+
elif operation == '3':
21+
print('{} * {} = '.format(num, num2))
22+
print(num*num2)
23+
24+
elif operation == '4':
25+
print('{} / {} = '.format(num, num2))
26+
print(num / num2)
27+
28+
else:
29+
print('Wrong Input! Please Try Again')

0 commit comments

Comments
 (0)