python 画画
奥运五环
import turtle
p = turtle
p.pensize(3)
# Blue ring
p.color('blue')
p.circle(30,360)
p.pu()
p.goto(60,0)
p.pd()
# Black ring
p.color('black')
p.circle(30,360)
p.pu()
p.goto(120,0)
p.pd()
# Red ring
p.color('red')
p.circle(30,360)
p.pu()
p.goto(90,-30)
p.pd()
# Green ring
p.color('green')
p.circle(30,360)
p.pu()
p.goto(30,-30)
p.pd()
# Yellow ring
p.color('yellow')
p.circle(30,360)
p.done()
菊花
import turtle
turtle.speed(100)
t = turtle.Pen()
t.color("gold")
t.pensize(7)
for x in range(12):t.shape("turtle")t.circle(100,360)t.left(30)
turtle.done()
python 画画
奥运五环
import turtle
p = turtle
p.pensize(3)
# Blue ring
p.color('blue')
p.circle(30,360)
p.pu()
p.goto(60,0)
p.pd()
# Black ring
p.color('black')
p.circle(30,360)
p.pu()
p.goto(120,0)
p.pd()
# Red ring
p.color('red')
p.circle(30,360)
p.pu()
p.goto(90,-30)
p.pd()
# Green ring
p.color('green')
p.circle(30,360)
p.pu()
p.goto(30,-30)
p.pd()
# Yellow ring
p.color('yellow')
p.circle(30,360)
p.done()
菊花
import turtle
turtle.speed(100)
t = turtle.Pen()
t.color("gold")
t.pensize(7)
for x in range(12):t.shape("turtle")t.circle(100,360)t.left(30)
turtle.done()