File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 ")
30-
31-
32-
331
342
353"""The previous script becomes very boring for the user as he has to keep on typing just numbers and of wants to interact using
You can’t perform that action at this time.
0 commit comments