-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode
More file actions
29 lines (27 loc) · 725 Bytes
/
code
File metadata and controls
29 lines (27 loc) · 725 Bytes
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
29
def add(num1,num2):
return num1+ num2
def sub(num1,num2):
return num1- num2
def mult(num1,num2):
return num1* num2
def div(num1,num2):
return num1/ num2
print('enter 1 for addition\n'
'enter 2 for subtraction\n'
'enter 3 for multiplication\n'
'enter 4 for division\n')
c= int(input('enter your choice : '))
num1=int(input('enter first number : '))
num2=int(input('enter second number : '))
if (c==1):
print(num1, "+", num2, "=",
add(num1, num2))
elif(c==2):
print(num1, "-", num2, "=",
sub(num1, num2))
elif(c==3):
print(num1, "*", num2, "=",
mult(num1, num2))
elif(c==4):
print(num1, "/", num2, "=",
div(num1, num2))