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 Answers
+ 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.