HOME/Articles/

simple python-example-24 (snippet)

Article Outline

Python example 'python-example-24'

python-example-24

Python example: python-example-24

#!/usr/bin/python
# -*- coding: UTF-8 -*-

a = 2.0
b = 1.0
s = 0
for n in range(1,21):
    s += a / b
    t = a
    a = a + b
    b = t
print(s)