fibonacci.py

Created by numworks-nl

Created on November 22, 2022

401 Bytes


from math import *
from turtle import *

penup()
goto(-50,-50)
speed(0)
pendown()
fibonacci=[1,1]
for u in range(7):
  fibonacci.append(fibonacci[u]+fibonacci[u+1])
for number in fibonacci:
  for i in range(5):
    forward(number*5)
    right(90)
  forward(number*5)

penup()
goto(-50,-50)
pendown()
pensize(2)
setheading(0)
for number in fibonacci:
  circle(-number*5,90)
  left(180)

During your visit to our site, NumWorks needs to install "cookies" or use other technologies to collect data about you in order to:

With the exception of Cookies essential to the operation of the site, NumWorks leaves you the choice: you can accept Cookies for audience measurement by clicking on the "Accept and continue" button, or refuse these Cookies by clicking on the "Continue without accepting" button or by continuing your browsing. You can update your choice at any time by clicking on the link "Manage my cookies" at the bottom of the page. For more information, please consult our <a href="https://www.numworks.com/legal/cookies-policy/">cookies policy</a>.