Lesson 4: Stars
Cette page nécessite un navigateur récent (avec support SharedArrayBuffer). Veuillez mettre à jour Chrome, Edge, Firefox ou Safari vers la dernière version.
English
Turn more than you need
- A star is a polygon where the turtle turns more at each corner.
- For a 5-point star, turn 144 degrees. The turtle goes round twice: 5 × 144 = 720.
Words for this lesson
| Word | Meaning |
|---|---|
| point | a sharp corner of a star |
| right | turn the other way (clockwise) |
English
A star
import turtle
for i in range(5):
turtle.forward(150)
turtle.right(144)
Difficulté 2/5 · 140 pièces + un petit bonus lors de la première réussite aujourd'hui
Draw a 5-point star with lines of 200 steps. Turn right(144) at each point.
Cliquez sur Exécuter pour voir le résultat ici.
Difficulté 3/5 · 200 pièces + un petit bonus lors de la première réussite aujourd'hui
Draw a 9-point star: 9 lines of 150 steps, turning right(160) each time.
Cliquez sur Exécuter pour voir le résultat ici.