../../../a0/olpc_LaptopOLPC_a_0102x0080_cc-by-sa_WM.jpg ../../../a0/GCompris_0152x0108.png ModLibre.info ../../../a0/puffin_medium_0076x0080.png
Introduction Chronique Demo Presentations Resources [pdf] WWW [v] ../../../a0/france.png

Python programs for Education and Research

Fibonacci Series

# coding: utf-8             Autorise les accents
# Copyright (C) 2007-2015   Creative Commons Attribution 2.5
#                           http://wiki.laptop.org/go/Pippy
# Initial version           Rafael Ortiz 
# Version       2015-10-01  Jean.Thiery@ModLibre.info
# Title:  Fibonacci Series
# Author: Rafael Ortiz 
# About:  The Fibonacci Number Series
# en:     http://en.wikipedia.org/wiki/Fibonacci_number
# fr:     http://fr.wikipedia.org/wiki/Suite_de_Fibonacci
# Shows:  Using tuple assignments. While loop.
# XO version
a, b = 1, 1
while b < 10000:                # tant que
    print(a)                    # imprime
    a, b = b, a+b
# Variations
# a, b = 1, -1
#    a, b = b, a-b              # suite de Fibonacci alternée


2018-01-31 © 2018 ModLibre.info (cc-by-sa license) W3C XHTML 1.0 CSS [^]