Q. Can you find an error or problem with the above code? Think about what happens if we evaluate check(3). What output would be produced by Python? Explain the reason(s) behind the output.

 

Answer =

 

Error is ‘maximum recursion depth exceeded in comparison’

It will give error when we evaluate check(3) error is ‘maximum recursion depth exceeded in comparison’ because in program in else clause there is no base case. If there is base case in else clause then it will give no error.

Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post