LearnPy Hub
← Iterators & Generators problems
Medium

Fibonacci Generator

Write an infinite generator of Fibonacci numbers (0, 1, 1, 2, ...). Print the first n using itertools.islice.

Input

One integer n ≥ 1.

Output

One line.

Sample 1

Input
10
Output
0 1 1 2 3 5 8 13 21 34

Sample 2

Input
1
Output
0
solution.py
Output appears here
Fibonacci Generator · Python practice problem · LearnPy Hub