loader

Let's learn Python Programming in easy ways.

Explore more

Start your python journey today

267
53
67
89

Today's question

Can you solve this ?
Question.

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=" ")

Options:

Get the answer and explanation
The Theory :

List of built-in functions

The Python interpreter has a number of functions and types built into it that are always available. They are listed below abs() delattr() hash() ...

Read more

Python MCQ Quiz

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.

Start now

How To

Code Snippets which helps in your project. Very much desirable for Python Professionals

Start now

Python Fundamental questions with answers

Topic wise fundamental Python questions with answers which will clear your fundamentals and will help you in interviews

Start now

What People Say about PythonEasy

Subscribe to Our Newsletter

Sign Up to our Newsletter to get the latest updates.

TOP