ExamVeda
Login
Home
21
What will be the output of the following Python code?
x = [34, 56]
print((''.join(list(map(str, x))),))
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
22
What will be the output of the following Python code?
x = [[0], [1]]
print(len(' '.join(list(map(str, x)))))
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
23
What will be the output of the following Python code?
x = ['ab', 'cd']
print(len(list(map(list, x))))))
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
24
What will be the output of the following Python code?
l1=[1, 2, 3, [4]]
l2=list(l1)
id(l1)==id(l2)
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?
def display(b, n):
    while n > 0:
        print(b,end="")
        n=n-1
display('z',3)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
What will be the output of the following Python code?
def foo(fname, val):
    print(fname(val))
foo(max, [1, 2, 3])
foo(min, [1, 2, 3])
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 cube(x):
    return x * x * x      
x = cube(3)    
print x
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
28
What is the purpose of a docstring in a function?
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?
def f1():
    global x
    x+=1
    print(x)
x=12
print("x")
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
30
What will be the output of the following Python code?
l1=[10, 20, 30]
l2=l1
id(l1)==id(l2)
 
l2=l1.copy()
id(l1)==id(l2)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board