Examveda

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

A. ValueError

B. Invalid

C. 6

D. ValueError("Invalid")

Answer: Option C


This Question Belongs to Python Program >> Exception Handling In Python

Join The Discussion

Related Questions on Exception Handling in Python