snt_042.py

Created by cent20

Created on September 10, 2024

624 Bytes

Ressource du TP de SNT, référence : TP 042
Ressource du DM de NSI, référence : E04.5
Egalement en librairie : 📙 Découvrir la NumWorks p.49


# [FR] Le python et la Tortue
# [EN] Python and the Turtle
from turtle import *
  
# Liste de couleurs, modifiable.
# List of colors, modifiable.
co = ["#CDB4DB", "#FFC8DD", "#FFAFCC", "#BDE2FE", "#A2D2FF"]
nb_co = len(co) # Ne pas modifier cette ligne.
speed(0)

# Paramètres, modifiables
# Parameters, modifiable
size = 12
angle = 55
repeter = 125

for i in range(repeter) :
  # Instructions, modifiables
  # Instructions, modifiable
  color(co[i%nb_co])
  pensize(size)
  forward(i)
  left(angle)
  
# Ce code sera à copier / coller puis à modifier.
# This code is to be copied/pasted and then modified.

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