#Practical No. - 2: WAP in Python to implement default and positional parameter
#Default Parameter
def show(a,b,c=8):
print("Sum=",(a+b+c))
show(5,6)
show(5,6,10)
def show1(a,b=9,c=8):
print("Sum1=",(a+b+c))
show1(5)
show1(5,6)
show1(5,6,10)
#Positional Parameter
def show2(a,b):
print("Sub=",(a-b))
show2(15,6)
show2(6,15)
No comments:
Post a Comment