ExamVeda
Login
Home
91
What will be the output of the following Python code?
def f1(x):
    global x
    x+=1
    print(x)
f1(15)
print("hello")
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
92
What will be the output of the following Python code?
def foo(x):
    x = ['def', 'abc']
    return id(x)
q = ['abc', 'def']
print(id(q) == foo(q))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
93
What is the value stored in sys.argv[0]?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
94
What will be the output of the following Python code?
def sayHello():
    print('Hello World!') 
sayHello() 
sayHello()
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
95
What will be the output of the following Python code?
l=[1, 2, 3, 4, 5]
m=map(lambda x:2**x, l)
print(list(m))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
96
What will be the output of the following Python code?
import functools
l=[1,2,3,4]
print(functools.reduce(lambda x,y:x*y,l))
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
97
What will be the output of the following Python code?
def foo():
    total += 1
    return total
total = 0
print(foo())
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
98
What is the type of sys.argv?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
99
What will be the output of the following Python code?
m=reduce(lambda x: x-3 in range(4, 10))
print(list(m))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
100
Read the following Python code carefully and point out the global variables?
y, z = 1, 2
def f():
    global x
    x = y+z
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board