PCAP-31-03 Exam QuestionsBrowse all questions from this exam

PCAP-31-03 Exam - Question 44


What is the expected behavior of the following code?

Show Answer
Correct Answer: B

The code contains an assertion statement 'assert m != 0' which will fail because the initial value of 'm' is 0. Hence, an AssertionError will be raised immediately when 'foo(0)' is called. Therefore, the code will not execute successfully.

Discussion

1 comment
Sign in to comment
DKAT2023Option: B
Jul 12, 2024

assert m !=0 , but m==0 , so an AssertionError will raise