Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
teaching:progappchim:suite_de_fibonacci [2013/10/17 14:28] – villersd | teaching:progappchim:suite_de_fibonacci [2017/02/24 08:50] (Version actuelle) – villersd | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Regardez, et essayez... | Regardez, et essayez... | ||
- | <sxh python; title : fibonacci01-mauvais.py> | + | <code python fibonacci01-mauvais.py> |
a = 0 | a = 0 | ||
- | print a | + | print(a) |
b = 1 | b = 1 | ||
- | print b | + | print(b) |
- | c=a+b | + | c = a + b |
- | print c | + | print(c) |
- | d=b+c | + | d = b + c |
- | print d | + | print(d) |
- | e=c+d | + | e = c + d |
- | print e | + | print(e) |
- | f=d+e | + | f = d + e |
- | print f | + | print(f) |
- | g=e+f | + | g = e + f |
- | print g | + | print(g) |
- | h=f+g | + | h = f + g |
- | print h | + | print(h) |
- | i=g+h | + | i = g + h |
- | print i | + | print(i) |
- | j=h+i | + | j = h + i |
- | print j | + | print(j) |
- | k=i+j | + | k = i + j |
- | print k | + | print(k) |
- | l=j+k | + | l = j + k |
- | print l | + | print(l) |
- | </sxh> | + | </code> |
Vous avez bien le début de la suite de Fibonacci. Mais pourquoi ce code est-il si mauvais ? | Vous avez bien le début de la suite de Fibonacci. Mais pourquoi ce code est-il si mauvais ? |