First experiment with turtle.

I tried playing around with turtle for the first time. I got the hang of it pretty quickly! First I got stopped by the extra functions, cause I didnt realise I should have added them to the list. Once I figured that out I could quickly replicate the code of the star and duplicate it at different angles around the screen. It was a very satisfying experience and I want to experiment more!
This commit is contained in:
sigrid
2025-08-28 15:36:16 +08:00
parent 83ace7a2f4
commit 4c1c6c8fa8
2 changed files with 89 additions and 0 deletions

View File

@@ -6,17 +6,99 @@ from turtle import (
penup,
pendown,
color,
pensize,
speed,
setheading,
circle,
goto,
begin_fill,
end_fill,
fillcolor,
)
pensize(2)
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
penup()
back(250)
right(90)
forward(100)
right(360 * 2 / 5)
pendown()
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
penup()
right(180)
forward(200)
right(360 * 2 / 5)
pendown()
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
penup()
goto(100,100)
forward(100)
pendown()
color('red')
forward(100)
right(360 * 2 / 5)
color('chocolate')
forward(100)
right(360 * 2 / 5)
color('gold')
forward(100)
right(360 * 2 / 5)
color('yellow green')
forward(100)
right(360 * 2 / 5)
color('steel blue')
forward(100)
right(360 * 2 / 5)
input()

7
poetry.lock generated Normal file
View File

@@ -0,0 +1,7 @@
# This file is automatically @generated by Poetry 2.1.4 and should not be changed by hand.
package = []
[metadata]
lock-version = "2.1"
python-versions = ">=3.10,<4.0"
content-hash = "7b8fc01b274bd807fb00372bbc8e138330f15ae7978ed61e180f3b17ec076725"