Commit 50467923 by BellCodeEditor

auto save

parent 9665b5ca
Showing with 321 additions and 12 deletions
name = "悟空"
word = "你好!谢谢你的欢迎!以后我们一起学习python吧!"
print(name+word)
"""
请使用turtle模块画出五角星
"""
import turtle
open=turtle.pen()
For i in range(5)
pen.forward(200)
pen.right(144)
pen.hideturtle()
pen.done()
\ No newline at end of file
import turtle as t
t.hideturtle()
t.screensize(820,700)
t.pensize(2)
t.speed(10)
#头部外圈轮廓
t.penup()
t.circle(150, 40)
t.pendown()
t.fillcolor('#00a0de')
t.begin_fill()
t.circle(150, 280)
t.end_fill()
t.seth(0)
t.fd(190)
#红色部分
t.begin_fill()
t.fillcolor('red')
t.circle(-10,180)
t.seth(180)
t.fd(190)
t.circle(-10,180)
t.end_fill()
t.fd(190)
#头部内圈轮廓
t.bk(15)
t.lt(40)
t.begin_fill()
t.fillcolor('white')
t.circle(120,160)
t.circle(120,120)
t.end_fill()
#眼睛轮廓
t.pu()
t.goto(-39.60,239.78)
t.pu()
t.fd(27)
t.seth(-90)
t.fd(10)
t.pd()
t.seth(0)
a = 0.6
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.06
t.lt(3)
t.fd(a)
else:
a -= 0.06
t.lt(3)
t.fd(a)
t.end_fill()
t.pu()
t.fd(52)
t.pd()
t.seth(5)
a = 0.6
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.06
t.lt(3)
t.fd(a)
else:
a -= 0.06
t.lt(3)
t.fd(a)
t.end_fill()
#眼珠
t.pu()
t.seth(90)
t.fd(10)
t.seth(180)
t.fd(7.5)
t.seth(7)
t.fillcolor('black')
t.begin_fill()
t.pd()
a = 0.27
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.01
t.lt(3)
t.fd(a)
else:
a -= 0.01
t.lt(3)
t.fd(a)
t.end_fill()
t.fillcolor('white')
t.seth(90)
t.pu()
t.fd(5)
t.pd()
t.seth(0)
a = 0.12
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.007
t.lt(3)
t.fd(a)
else:
a -= 0.007
t.lt(3)
t.fd(a)
t.end_fill()
t.pu()
t.goto(25.58,222.42)
t.bk(38.5)
t.pd()
a = 0.27
t.fillcolor('black')
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.01
t.lt(3)
t.fd(a)
else:
a -= 0.01
t.lt(3)
t.fd(a)
t.end_fill()
t.fillcolor('white')
t.seth(90)
t.pu()
t.fd(5)
t.pd()
t.seth(0)
a = 0.12
t.begin_fill()
for i in range(120):
if 0 <= i < 30 or 60 <= i < 90:
a += 0.007
t.lt(3)
t.fd(a)
else:
a -= 0.007
t.lt(3)
t.fd(a)
t.end_fill()
#鼻子
t.pu()
t.goto(-12.92,222.42)
t.seth(0)
t.fd(18)
t.pd()
t.fillcolor('Brown2')
t.begin_fill()
t.circle(-17,360)
t.end_fill()
t.pu()
t.seth(-90)
t.fd(10)
t.seth(180)
t.fd(2)
t.seth(0)
t.pd()
t.fillcolor('white')
t.color('white')
t.begin_fill()
t.circle(-5,360)
t.end_fill()
#鼻子下的一条线
t.color('black')
t.pu()
t.goto(5.08,188.42)
t.seth(-90)
t.pd()
t.fd(112.5)
#右边胡子
t.pu()
t.goto(5.08,188.42)
t.seth(0)
t.fd(30)
t.seth(90)
t.fd(5)
t.pd()
t.seth(25)
t.fd(67)
t.pu()
t.goto(35.08,188.42)
t.seth(-90)
t.fd(15)
t.seth(5)
t.pd()
t.fd(67)
t.pu()
t.goto(35.08,188.42)
t.seth(-90)
t.fd(35)
t.seth(-15)
t.pd()
t.fd(67)
#左边胡子
t.pu()
t.goto(35.08,153.42)
t.seth(180)
t.fd(65)
t.pd()
t.seth(195)
t.fd(67)
t.pu()
t.goto(35.08,173.42)
t.seth(180)
t.fd(65)
t.pd()
t.seth(175)
t.fd(67)
t.pu()
t.goto(35.08,193.42)
t.seth(180)
t.fd(65)
t.pd()
t.seth(150)
t.fd(67)
#嘴巴
t.pu()
t.goto(5.08,75.92)
t.seth(0)
t.pd()
t.circle(120,55)
t.pu()
t.goto(5.08,75.92)
t.seth(0)
t.pd()
t.circle(120,-55)
#铃铛
t.pu()
t.goto(-96.42,15.09)
t.seth(0)
t.fd(85)
t.pd()
t.seth(70)
t.fillcolor('#ffd200')
t.begin_fill()
t.circle(-20)
t.end_fill()
t.seth(170)
t.fillcolor('#ffd200')
t.begin_fill()
t.circle(-2, 180)
t.seth(10)
t.circle(-100, 22)
t.circle(-2, 180)
t.seth(180 - 10)
t.circle(100, 22)
t.end_fill()
t.seth(250)
t.pu()
t.circle(20, 110)
t.seth(90)
t.fd(15)
t.pd()
t.dot(10)
t.seth(-90)
t.fd(12.5)
t.mainloop()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment