Skip to content

Latest commit

 

History

History
34 lines (19 loc) · 568 Bytes

File metadata and controls

34 lines (19 loc) · 568 Bytes

Iterator Example - Fibonacci Sequence

Question

Example of an iterator generating Fibonacci sequence

Solution

.. literalinclude:: ../../languages/python/design_iterator_ex1.py
   :language: python
   :tab-width: 4

.. runcode:: ../../languages/python/design_iterator_ex1.py
   :language: python
   :codesite: ideone

Explanation

.. seealso::

   * :python-suggest-improve:`design_iterator_ex1.py`
   * :python-better-explain:`design_iterator_ex1.rst`