Python Unit3 Fun MCQ
Python Unit3 Fun MCQ
a)3 b) 4
c) 4 is maximum
d) None of the mentioned
a) Hello
WorldWorldWorldWorldWorld
b) Hello
World 5
c) Hello
World,World,World,World,World
d) Hello
HelloHelloHelloHelloHello
5 What will be the output of the following Python code?
a) 2
b) 3
c) The numbers are equal
d) None of the mentione
def fn(a):
print(a)
x=90
fn(x)
print(print(print("javatpoint")))
d Javatpoint
1. x = 50
2. def func(x):
3. print('x is', x)
4. x = 2
5. print('Changed local x to', x)
6. func(x)
7. print('x is now', x)
a) x is 50
Changed local x to 2
x is now 50
b) x is 50
Changed local x to 2
x is now 2
c) x is 50
Changed local x to 2
x is now 100
d) None of the mentioned
1. def cube(x):
2. return x * x * x
3. x = cube(3)
4. print x
a) 9
b) 3
c) 27
d) 30
31 If a function doesn’t have a return statement, which of the following does the
function return?
a) int
b) null
c) None
d) An exception is thrown without the return statement
a) String
b) Tuple
c) Dictionary
d) An exception is thrown
i=0
def change(i):
i=i+1
return i
change(1)
print(i)
a) 1
b) Nothing is displayed
c) 0
d) An exception is thrown
def a(b):
b = b + [5]
c = [1, 2, 3, 4]
a(c)
print(len(c))
a) 4
b) 5
c) 1
d) An exception is thrown
a) Integer
b) Tuple
c) Dictionary
d) An exception is thrown
a) zzz
b) zz
c) An exception is executed
d) Infinite loop