python繪制圣誕樹終章
一位朋友送給相愛18年的閨蜜的圣誕樹,是定制款吶

# 襪子
seth(-20)
pensize(2)
penup()
goto(-30, 130)
pencolor("black")
pendown()
begin_fill()
fillcolor('white')
fd(32)
circle(4, 180)
fd(32)
circle(4, 180)
end_fill()
penup()
goto(-25, 130)
pendown()
begin_fill()
fillcolor("red")
seth(-110)
fd(20)
seth(150)
fd(7)
circle(10, 180)
seth(-25)
fd(20)
circle(10, 90)
seth(68)
fd(28)
seth(160)
fd(26)
end_fill()
penup()
seth(0)
goto(-50, -240)
pendown()
hideturtle()
# # 蘋果
penup()
goto(58, 30)
pendown()
pensize(2)
begin_fill()
circle(15)
fillcolor('red')
end_fill()
penup()
goto(45, 27)
pendown()
pensize(3)
seth(-100)
circle(5, 180)
penup()
goto(50, 20)
pendown()
pensize(2)
seth(85)
for i in range(5):
fd(4)
right(8)
# 圣誕棒
pencolor('black')
penup()
goto(-80, -50)
pendown()
begin_fill()
fillcolor('red')
seth(110)
circle(-6, 180)
seth(20)
fd(10)
seth(110)
circle(16, 180)
seth(-60)
fd(45)
seth(20)
for i in range(9):
fd(1)
left(5)
seth(120)
fd(42)
end_fill()
# 圣誕帽
seth(-20)
pensize(3)
penup()
goto(-60, -144)
pencolor("black")
pendown()
begin_fill()
fillcolor('white')
fd(45)
circle(4, 180)
fd(45)
circle(4, 180)
end_fill()
penup()
goto(-55, -135)
seth(75)
pendown()
begin_fill()
seth(60)
for i in range(10):
fd(4)
right(6)
seth(-10)
for i in range(8):
fd(8)
right(15)
seth(115)
for i in range(4):
fd(5)
left(2)
seth(90)
for i in range(5):
fd(2)
left(5)
seth(-90)
for i in range(4):
fd(5)
right(15)
seth(161)
fd(45)
fillcolor('red')
end_fill()
penup()
goto(3, -162)
pendown()
pensize(2)
pencolor('black')
circle(5)
這里就放幾個比較好看的的吶,需要自取哦,喜歡就點個贊,給個關注吧
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/385608.html
標籤:python
上一篇:python幾行代碼實作郵件決議
