lundi 27 mai 2019

I don't understand the answer to this question

What sequence of numbers would be printed if the following function were executed with the value of N being 0?

def xxx(N):
        print(N)
        if (N < 5):
        xxx(N + 2)
            print(N)

in my answers, it says the output should be : 0, 2, 4, 6, 6, 4, 2, 0

Aucun commentaire:

Enregistrer un commentaire