Chapter 4 MCQS
Chapter 4 MCQS
x = 50
x is 50 x is 50 x is 50
def func(x):
21 Changed local x to 2 Changed local x to 2 Changed local x to 2 none A
print('x is', x)
x is now 50 x is now 2 x is now 100
x=2
print('Changed local x to', x)
func(x)
print('x is now', x)
What will be the output of the following
Python code?
Hello Hello Hello Hello
22 def say(message, times = 1): A
WorldWorldWorldWorldWorld World 5 World,World,World,World,World HelloHelloHelloHelloHello
print(message * times)
say('Hello')
say('World', 5)
What will be the output of the following
Python code?
def func(a, b=5, c=10): a is 7 and b is 3 and c is 10 a is 3 and b is 7 and c is 10 a is 3 and b is 7 and c is 10
23 print('a is', a, 'and b is', b, 'and c is', c) a is 25 and b is 5 and c is 24 a is 5 and b is 25 and c is 24 a is 25 and b is 5 and c is 24 None of the mentioned C
a is 5 and b is 100 and c is 50 a is 50 and b is 100 and c is 5 a is 100 and b is 5 and c is 50
func(3, 7)
func(25, c = 24)
func(c = 50, a = 100)
What will be the output of the following
24 Error TRUE FALSE 0 B
Python function? any([2,4,0,6])
What will be the output of the following
25 Error xyz 0 TRUE A
Python function? float("xyz")
What will be the output of the following
26 Error TRUE FALSE 0 C
Python function? print(bool([])
What will be the output of the following
27 17 7 0 Error A
Python function? print(sum([1,2,4],10)
What will be the output of the following
28 16 -16 0 error A
Python function? print(pow(-4,2))
What will be the output of the following
29 1 1+j 1+0j Error C
Python function? print(complex(1))
The ___ statement is used to important all
30 extend implement import deliver C
the functionality of one module into another.
what will be the output of following build in
31 24 25 26 25.1 C
module? print(math.ceil(25.1))
which method generate random float number
32 random.uniform random.random random.float random.randfloat A
in given range?
____ returns a random integer between the
33 random.uniform random.random random.int random.randint D
specifies integers.
____is the core library for scientific
34 numpy scipy matplotlib pandas A
computing in python.