Skip to content

Instantly share code, notes, and snippets.

@eloidrai
Created March 13, 2019 16:27
Show Gist options
  • Save eloidrai/dc89473bc6408929f53c35018e0e5f8d to your computer and use it in GitHub Desktop.
Save eloidrai/dc89473bc6408929f53c35018e0e5f8d to your computer and use it in GitHub Desktop.
Ce programme dessine une spirale de Fibonacci.
#coding: utf-8
import turtle
iterations = int(input("Combien d'itérations ? "))
def fib(n):
l = [1,1]
for f in range(n-2):
l.append(l[-1]+l[-2])
return l
def spirale(nbs_iterations):
for f in fib(nbs_iterations):
turtle.circle(f,180)
spirale(iterations)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment