Python for Kids

Puzzle Number 6

Posted, 6 Mar 2013

Difficulty: medium - hard

Depending upon what year you are at school, you may (or may not) have heard of the Fibonacci Series. Fibonacci is a series of numbers starting with 0 and 1, and you find the next number in the series by adding the previous two numbers. So after 0 and 1, is 1 (0 + 1), then 2 (1 + 1), and then 3, and so on. Here's a few more numbers in the series:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34

Try creating a Python function which will tell you the nth number in the Fibonacci Series (the 5th, the 10th or the 200th, for example).

Update: The full solution can be found here.