Fibonacci em Python

Posted on 19 Maio, 2008. Filed under: Programação |

É simplesmente muito mais simples que em C ou Java, sem falar que o trabalho é muito menor, que em uma dessas linguagens, já que o algoritmo consiste na soma de dois números para que se crie uma serie, veja a seguir o codigo do programinha.

>>> a, b = 0, 1
>>> while b<10:
b
a, b = b, a+b

1
1
2
3
5
8
>>>

Make a Comment

Make A Comment: ( None so far )

blockquote and a tags work here.

    About

    Um pouco do que é visto no meu curso de engenharia

    RSS

    Subscribe Via RSS

    • Subscribe with Bloglines
    • Add your feed to Newsburst from CNET News.com
    • Subscribe in Google Reader
    • Add to My Yahoo!
    • Subscribe in NewsGator Online
    • Os últimos comentários a todos os artigos em RSS
    • Subscribe in Rojo

    Meta

Liked it here?
Why not try sites on the blogroll...