Created
March 13, 2019 16:27
-
-
Save eloidrai/dc89473bc6408929f53c35018e0e5f8d to your computer and use it in GitHub Desktop.
Ce programme dessine une spirale de Fibonacci.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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