Write a programElementary20 XPExercise 6/16

The Fibonacci sequence

Task

The Fibonacci sequence starts with 0 and 1, and every next number is the sum of the previous two: 0, 1, 1, 2, 3, 5, 8, 13, …

The program reads a positive whole number n and prints the first n members of the sequence, each on its own line.

Examples

  • Input

    7

    Expected output

    0
    1
    1
    2
    3
    5
    8

After you submit, 4 hidden tests will also check your solution: n = 1, n = 2, 20 members, 40 members.

Python starts the first time you run code.

Ctrl+Enter runs the program. Tab indents. Press Esc, then Tab, to leave the editor.

Input (stdin)

Each line = one call to input().

Output

Hints

Try it yourself first. Each hint reveals a little more - and lowers the reward a little.

Signed out, hints are free - but no XP is awarded either.

Solution

The solution unlocks after the last hint.