-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdef func.py
More file actions
30 lines (29 loc) · 753 Bytes
/
def func.py
File metadata and controls
30 lines (29 loc) · 753 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
30
#def function for all arithmetic operations.
def add():
a=10
b=5
c=a+b
print('Calling adding func first time of a and b is ',c)
def sub2(a,b):
c=a-b
print('calling function with parameter for second time',c)
def mul3():
a=int(input('Value of a :'))
b=int(input('Value of b :'))
c=a*b
return(c)
def div4(a,b):
a=int(input('Value of a :'))
b=int(input('Value of b :'))
c=a/b
return(c)
#no parameters and no returns.
add()
#parameters and no returns
sub2(15,5)
#No parameters and returns
a3 = mul3()
print('calling function with return for third time',a3)
#parameters and returns
a4 = div4(15,15)
print('calling function with parameter and return for fourth time ',a4)