ExamVeda
Login
Home
21
Which of these is false about recursion?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
22
What is the purpose of using the * symbol in function argument packing?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
23
What is the type of each element in sys.argv?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
24
What will be the output of the following Python code?
l=[]
def convert(b):
    if(b==0):
        return l
    dig=b%2
    l.append(dig)
    convert(b//2)
convert(6)
l.reverse()
for i in l:
    print(i,end="")
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
25
What will be the output of the following Python code?
l=[n for n in range(5)]
f=lambda x:bool(x%2)
print(f(3), f(1))
for i in range(len(l)):
    if f(l[i]):
        del l[i]
        print(i)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
The single line equivalent of the following Python code?
l=[1, 2, 3, 4, 5]
def f1(x):
    return x<0
m1=filter(f1, l)
print(list(m1))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
27
What will be the output of the following Python code?
def C2F(c):
    return c * 9/5 + 32
print C2F(100)
print C2F(0)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
28
What will be the output of the following Python code?
def say(message, times = 1):
    print(message * times)
say('Hello')
say('World', 5)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
29
What will be the output of the following Python code?
f=lambda x:bool(x%2)
print(f(20), f(21))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
30
What will be the output of the following Python code?
import functools
l=[1, 2, 3, 4, 5]
m=functools.reduce(lambda x, y:x if x>y else y, l)
print(m)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board