Worksheet Function 3
Worksheet Function 3
com
print("Hello") #Line 3
print("Bye") #Line 5
else: #Line 6
1|Page
www.python4csip.com
Cube(n) # n is 10 here
print(Cube(n))
9 What are the different types of actual arguments in function? Give example of any one
of them.
10 What will be the output of following code:
def Alter(x, y = 10, z=20):
sum=x+y+z
print(sum)
Alter(10,20,30)
Alter(20,30)
Alter(100)
Swap(______, ______)
2|Page
www.python4csip.com
Interest(20000,.08,15) #Line 1
Interest(T=10,20000,.075) #Line 2
Interest(50000,.07) #Line 3
Interest(P=10000,R=.06,Time=8) #Line 4
Interest(80000,T=10) #Line 5
14 What will be the output of following code?
def Calculate(A,B,C):
return A*2, B*2, C*2
val = Calculate(10,12,14)
print(type(val)) print(val)
3|Page
www.python4csip.com
def Alter(M,N=50):
M=M+N
N=M-N
print(M,"@",N)
return M
A=200
B=100
A = Alter(A,B)
print(A,"#",B)
B = Alter(B)
print(A,’@’,B)
4|Page
www.python4csip.com
def Total(Number=10):
Sum=0
for C in range(1,Number+1):
if C%2==0:
continue
Sum+=C
return Sum
print(Total(4))
print(Total(7))
print(Total())
5|Page
www.python4csip.com
n = 120
n=Fun1(n)
print(n)
6|Page
www.python4csip.com
else:
mylist[i]*=2
7|Page