0
I faced question below in py challenge. So i ran the code in sololearn compiler. The output was 34. Why?
What is the output of this code? def rec(n): n%5 if n<=1: return n else: return rec(n-1)+rec(n-2) print(rec(9)) The answer in challenge was: 3 by Александр Громозонов
2 Antworten
+ 3
Should it maybe be:
n%=5
instead of:
n%5
which doesn't change anything?
Then the answer would be 3.
0
Yeah. I'm so sorry, it's my mistake, thank you very much.