Question from the Python test

Why is the output of the following code undefined? ``` def f(n): return n + 1 f(n) ```

Hard

The following code does not return 5, why? (One correct answer)

Author: Antoine BrennerStatus: PublishedQuestion passed 1722 times
Edit
3
Community Evaluations
developer avatar
Frédéric
11/05/2023
J'ai adorĂ©. Je me suis creusĂ© la tĂȘte longtemps sur cette question, Ă  laquelle je me suis vautrĂ© en rĂ©pondant qu'elle retournait 5 en oubliant le scope de n qui Ă©tait global Mais on aurait Ă©crit fns[n]=lambda n=n, *a, **k: n lĂ  ça retournait bien 5!!!