ExamVeda
Login
Home
21
What will be the output of the following Python code?
def f(x):
    yield x+1
    print("test")
    yield x+2
g=f(9)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
22
What happens when '1' == 1 is executed?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
23
Which of the following is not a standard exception in Python?
Discuss
Answer & Solution
Answer: Option C
No explanation is given for this question. Let's Discuss on Board
24
Is the following Python code valid?
try:
    # Do something
except:
    # Do something
finally:
    # Do something
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
25
What is the purpose of the except clause without specifying an exception type in a try block?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
26
What is the purpose of the else clause in a try block?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
27
Identify the type of error in the following Python codes?
Print(“Good Morning”)
print(“Good night)
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
28
Which of the following is not a standard Python exception?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
29
What is the purpose of the sys.exc_info() function in Python?
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?
g = (i for i in range(5))
type(g)
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board