How to calculate Fibonacci sequence in Python.

Create a file called fib.py.

<pre lang="bash">
nterms = int(input("How many terms? "))
n1, n2 = 0, 1
count = 0
if nterms 
<p>Run it.</p>
<pre lang="bash">
$ python fib.py
How many terms? 5
Fibonacci sequence:
0
1
1
2
3

<p>Again.</p>
<pre lang="bash">
$ python fib.py
How many terms? 10
Fibonacci sequence:
0
1
1
2
3
5
8
13
21
34