samedi 16 juillet 2016

python-writing q as a function of i in a for loop


I'm completely new to python so forgive me if this question is stupid.I am try to code for a Fibonacci sequence and wanted to know if there is a way for me to write q as a function of i in a for loop. like:

 for i in range (1,x): 
    q(i)=q(i-1)+q(i-2)

Aucun commentaire:

Enregistrer un commentaire