What is the expected behavior of the following code?

Posted by: Pdfprep Category: PCAP-31-03 Tags: , ,

What is the expected behavior of the following code?

A . it outputs 2
B . the code is erroneous and it will not execute
C . it outputs 1
D . it outputs 3

Answer: D

Comment (1)

  • egv Reply

    Correct answer is C, not D, since the assert condition returns False end then an AssertionError exception is raised just after foo(0) is executed.

    February 17, 2023 at 6:31 pm

Leave a Reply

Your email address will not be published.