Python Exercise: Fibonacci series between 0 to 50
9. Fibonacci Series Between 0 and 50
Write a Python program to get the Fibonacci series between 0 and 50.
Note : The Fibonacci Sequence is the series of numbers :
0, 1, 1, 2, 3, 5, 8, 13, 21, ....
Every next number is found by adding up the two numbers before it.
Pictorial Presentation:

Sample Solution:
Python Code:
Sample Output:
1 1 2 3 5 8 13 21 34
Flowchart:

For more Practice: Solve these Related Problems:
- Write a Python program to generate the Fibonacci sequence up to 50 using a while loop.
- Write a Python program to use recursion to print all Fibonacci numbers less than 50.
- Write a Python program to build the Fibonacci series up to a given limit and store the result in a list.
- Write a Python program to implement the Fibonacci sequence using list comprehension and a generator function.
Go to:
Previous: Write a Python program that prints all the numbers from 0 to 6 except 3 and 6.
Next: Write a Python program which iterates the integers from 1 to 50. For multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz".
Python Code Editor :
Have another way to solve this solution? Contribute your code (and comments) through Disqus.
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.