Level: Beginner
Focus: Loops
Counting Rabbits Question
In a Fibonacci sequence each number is the sum of the previous two numbers (i.e., it starts with 0,1,1,2,3,5,8 and continues on). The sequence is the result of Fibonacci's attempt in 1202 to find out how many rabbits you get after a certain number of generations. Each number represents how many pairs of rabbits there would be when they are breeding under ideal circumstances. The task is to write a program that calculates and displays the first 22 numbers of a Fibonacci sequence.
Your code will display Fibonacci's hypothesis for 20 generations of rabbits (the first two numbers represent the start of the population and the maturing of the first pair of rabbits).
To get the most out of this question try and figure out the answer before coming back to read the solution on the next page.

