Exam PCAP-31-03 All QuestionsBrowse all questions from this exam
Question 44

What is the expected behavior of the following code?

    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
DKAT2023Option: B

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