ExamVeda
Login
Home
11
What will be the output of the following Python code?
l=[1, -2, -3, 4, 5]
def f1(x):
    return x<2
m1=filter(f1, l)
print(list(m1))
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
12
How can you pass a list to a function as an argument?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
13
What will be the output of the following Python code?
x = 'abcd'
print(list(map(list, x)))
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
14
How are default arguments specified in the function heading?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
15
How are variable length arguments specified in the function heading?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
16
Which type of copy is shown in the following python code?
l1=[[10, 20], [30, 40], [50, 60]]
ls=list(l1)
ls
[[10, 20], [30, 40], [50, 60]]
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
17
What will be the output of the following Python code?
odd=lambda x: bool(x%2)
numbers=[n for n in range(10)]
print(numbers)
n=list()
for i in numbers:
    if odd(i):
        continue
    else:
        break
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
18
What will be the output of the following Python code?
x = 1234
print(list(map(list, x)))
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
19
What will be the output of the following code:
def multiply(a, *args):
  result = a
  for num in args:
    result *= num
  return result
result = multiply(2, 3, 4)
print(result)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
20
What happens if a local variable exists with the same name as the global variable you want to access?
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board