tortue_2de_tp1.py

Created by jean-luc-poncin

Created on September 06, 2021

558 Bytes

Tracé de figures simples à la tortue, à l’aide de 2 procédures fig1 et fig2. Tracé de dessins en utilisant ces procédures fig1 et fig2.


from turtle import *

def fig1():
  forward(50)
  penup()
  forward(30)
  pendown()
  forward(20)
  left(90)
  forward(80)
  right(90)
  forward(50)

def fig2():
  forward(120)
  right(90)
  forward(80)
  right(90)
  forward(40)
  penup()
  forward(40)
  pendown()
  forward(40)
  right(90)
  forward(80)
  
def dessin():
  fig2()
  penup()
  forward(100)
  right(90)
  pendown()
  fig2()
  penup()
  left(90)
  forward(150)
  right(180)
  pendown()
  fig2()
  penup()
  right(180)
  forward(100)
  left(90)
  pendown()
  fig2()
  




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 cookies policy.