Vidyalelo
Python · Q20

Exception Handling in Python

Programming · Python · question 20

Q20

What will be the output of the following Python code? def getMonth(m): if m 12: raise ValueError("Invalid") print(m) getMonth(6)

A.
ValueError
B.
Invalid
C.
6
Answer
D.
ValueError("Invalid")

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board