What should be corrected in this code ??? if im totally wrong help would be appreciated | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

What should be corrected in this code ??? if im totally wrong help would be appreciated

def fib(x): if x==0 or x==1: return 1 else: return fib(x)+fib(x-1) if x==5: break else: return x a = fib(10) print(list(a))

10th Feb 2020, 4:02 PM
Md Shoaib
Md Shoaib - avatar
1 Antwort
0
Please tag 'Python recursion'. A single letter 'a' doesn't help with context clarity 👍
10th Feb 2020, 5:03 PM
Ipang