ExamVeda
Login
Home
41
What will be the output of the following Python code?
x = ['ab', 'cd']
print(list(map(list, x)))
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
42
What will be the output of the following Python code?
def change(i = 1, j = 2):
    i = i + j
    j = j + 1
    print(i, j)
change(j = 1, i = 2)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
43
What will be the output of the following Python code?
def ram(x):
    print(x+1)
x=-2
x=4
ram(12)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
44
What will be the output of the following Python code?
x = 50
def func(x):
    print('x is', x)
    x = 2
    print('Changed local x to', x)
func(x)
print('x is now', x)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
45
What will be the output of the following Python code?
x = [34, 56]
print((''.join(list(map(str, x)))),)
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
46
What is the output of the following code:
def multiply(a, b=2):
  return a * b
result = multiply(4)
print(result)
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
47
What will be the output of the following Python code?
x = 5 
def f1():
    global x
    x = 4
def f2(a,b):
    global x
    return a+b+x
f1()
total = f2(1,2)
print(total)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
48
What will be the output of the following Python code?
def f1():
    x=15
    print(x)
x=12
f1()
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
49
What will be the output of the following Python code?
def find(a, **b):
   print(type(b))
find('letters',A='1',B='2')
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
50
What will be the output of the following Python code?
def foo():
    return total + 1
total = 0
print(foo())
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board