What is the output of the following code ?
def foo(x):
if x == 0:
return 0
elif x == 1:
return 1
else:
return foo(x-1)+foo(x-2)
for i in range(0, 6):
print(foo(i), end=" ")
Beginners can practice 300 + Python topic wise MCQ questions which will enhance the command on a particular topic. Experienced pythonistas can start testing their knowledge.
Code Snippets which helps in your project. Very much desirable for Python Professionals
Topic wise fundamental Python questions with answers which will clear your fundamentals and will help you in interviews