ExamVeda
Login
Home
31
How can you catch and handle multiple exceptions in a single except block in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
32
What is the output of the following code:
try:
x = 10 / 0
except ZeroDivisionError:
print("Error!")
finally:
print("Finally!")
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
33
What will be the output of the following Python code?
def foo():
    try:
        print(1)
    finally:
        print(2)
foo()
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
34
What will be the output of the following Python code?
int('65.43')
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
35
How can you catch and handle multiple exceptions in a single except block in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
36
What is the syntax to raise an exception manually in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
37
An exception is . . . . . . . .
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
38
What will be the output of the following Python code?
def f(x):
    yield x+1
    print("test")
    yield x+2
g=f(10)
print(next(g))
print(next(g))
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
39
Which of the following statements is true regarding the order of except clauses?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
40
Compare the following two Python codes shown below and state the output if the input entered in each case is -6?
CODE 1
import math
num=int(input("Enter a number of whose factorial you want to find"))
print(math.factorial(num))
 
CODE 2
num=int(input("Enter a number of whose factorial you want to find"))
print(math.factorial(num))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board