Advertisements
Advertisements
प्रश्न
What would be the output of the following code?
def evenNumber (number):
assert (number % 2 == 0), "not even"
print ("Number is even")
evenNumber (7)
पर्याय
No output
Not even
Number is even
Assertion Error: not even
MCQ
उत्तर
Assertion Error: not even
Explanation:
The number seven is not even. AssertionError is raised because the remainder for 7/2 is not zero.
shaalaa.com
Built-in Exceptions
या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?