def fibonacci(n):
    a, b = 0, 1
    while n:
        a, b = b, a + b
        n -= 1
    return a

fibonacci(100)

"""
Explanation: About Jupyter Notebook
Jupyter Notebook can be used for:

Interactive data exploration;
Data analytics and visualization;
Financial quantitatve analysis;
Learning Python, R, Julia and dozens of other supported languages

The name Jupyter mixes Julia, Python and R, the first three languages targeted after iPython Notebook was reenginered to support different language processors (called kernels). This notebook is using the Python 3 kernel, as indicated in the top right corner.
Jupyter is a browser-based application that to edit and share interactive documents called notebooks.
Interacting with a Jupyter Notebook
As a first step, please take the User Interface Tour available from the Help menu above. 
A notebook is made of text and code cells. You are reading a text cell, formatted using the Markdown syntax. To learn more about editing Markdown in Jupyter, read Working With Markdown Cells (local copy).
Code cells
Code cells are written in the programming language supported by the running kernel. They produce output in the form of text, tables or graphics. This is a code cell:
End of explanation
"""


2**100

"""
Explanation: The label In [n] on the left indicates that is a code cell. If there's no n, the cell has not been executed. You can execute a code cell by selecting it and pressing the &lt;ctrl&gt;&lt;enter&gt; keyboard combination.  Please do it now and you'll see the 100th number in the Fibonacci sequence displayed in a new output cell, labeld Out [n], where n matches the number of the code cell that produced that output.
You can edit a code or text cell by clicking on it. Please edit the code cell above, changing the 100 argument in the fibonacci(100) function call to another number.
The content of a cell can be as simple as math expression like the one below. Use &lt;shift&gt;&lt;enter&gt; to run it and select the next cell.
End of explanation
"""


%ls -la

"""
Explanation: Magic commands
In addition to the syntax of the kernel language, code cells support magic commands, which a are written with a % prefix, like this:
End of explanation
"""


%magic

"""
Explanation: To learn about the available magic commands, run %magic:
End of explanation
"""


%matplotlib inline
# use the "magic" command above once to configure inline graphs

import matplotlib.pyplot as plt
plt.bar(range(1, 7), [fibonacci(n) for n in range(1, 7)])
plt.xlabel('Fibonnacci numbers')
plt.show()

"""
Explanation: Graphics
Several graphing libraries can be used with the Python kernel, but the most popular is matplotlib.
To draw graphs in a notebook, use the magic command %matplotlib inline and the matplotlib.pyplot object, conventionally imported as plt:
End of explanation
"""


with plt.xkcd():
    plt.bar(range(1, 7), [fibonacci(n) for n in range(1, 7)])
    plt.xlabel('vacation days')
    plt.ylabel('ice cream gallons')
    plt.show()

"""
Explanation: If you want to convey an idea instead of actual data, you may want to format a graph as in the style of a xkcd comic:
End of explanation
"""


import matplotlib as mpl
font_cache_path = mpl.get_cachedir() + '/fontList*.cache'
# uncomment the magic command below to actually clear the cache
# %rm $font_cache_path

"""
Explanation: Attention: the Humor-Sans.ttf font needs to be installed for correct display of xkcd graphics.
After installing the font, if you still get a missing font warning, run the cell below to clear the Jupyter font cache.
End of explanation
"""


from IPython.display import IFrame
IFrame('https://en.wikipedia.org/wiki/Fibonacci_number', width='100%', height=400)

"""
Explanation: Multimedia displays
The display module of the IPython API allows embedding several external media types into a notebook, including a Web page:
End of explanation
"""


