a) Reducing duplication of code
b) Decomposing complex problems into simpler pieces
c) Improving clarity of the code
d) Reuse of code
e) Information hiding
f) All of the mentioned
a) Custom function
b) Built-in function
c) User-Defined function
d) System function
a) Module
b) Class
c) Another function
d) None of the mentioned
a) Module
b) Class
c) Another function
d) Method / attribute
a) Id returns the identity of the object
b) Every object doesn’t have a unique id
c) All of the mentioned
d) None of the mentioned
a) sqrt
b) rhombus
c) add
d) rhombus
What is the output of below program?
def cube(x):
return x * x * x
x = cube(3)
print x
a) 9
b) 3
c) 27
d) 30
What is the output of the below program?
def C2F(c):
return c * 9/5 + 32
print C2F(100)
print C2F(0)
a) 212 & 32
b) 314 & 24
c) 567 & 98
d) None of the mentioned
What is the output of the below program?
def power(x, y=2):
r = 1
for i in range(y):
r = r * x
return r
print power(3)
print power(3, 3)
a) 212 & 32
b) 9 & 27
c) 567 & 98
d) None of the mentioned
What is the output of the below program?
def sum(*args):
'''Function returns the sum of all values'''
r = 0
for i in args:
r += i
return r
print(sum.__doc__)
print(sum(1, 2, 3))
print(sum(1, 2, 3, 4, 5))
a) 6 & 15
b) 6 & 100
c) 123 & 12345
d) None of the mentioned
Write a program to
What is the output of the following
def func(i, x=[]):
x.append(x.append(i))
return x
y = 0
for i in range(10):
y = func(i)
print(y)