What should be corrected in this code ??? if im totally wrong help would be appreciated | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
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 Respuesta
0
Please tag 'Python recursion'. A single letter 'a' doesn't help with context clarity 👍
10th Feb 2020, 5:03 PM
Ipang