标签:半径 基础练习 down 黄色 forward color extent col 同心圆
import turtle
# circle有三个参数,1.半径每像数,2.steps=X 分部,3.extent=X 度数
#画一个半径为十的圆
#turtle.circle(10)
#画一个正八边形
#turtle.circle(30,steps=8)
#画一个120的弧
#turtle.circle(50,extent=120)
#1.同切圆
#for i in range(10):
# turtle.circle(100-(i*10))
#2.同心圆
#for i in range(10):
# turtle.up()
# turtle.goto(0,i*10)
# turtle.down()
# turtle.circle(100-(i*10))
#3.五角星
#for i in range(5):
# turtle.forward(100)
# turtle.right(144)
#4.填充黄色的五角星
#turtle.color(‘yellow‘)
#turtle.fillcolor(‘yellow‘)
#turtle.begin_fill()
#for i in range(5):
# turtle.forward(100)
# turtle.right(144)
#turtle.end_fill()
#在红底下的五颗五角星
turtle.color(‘yellow‘)
turtle.fillcolor(‘yellow‘)
turtle.bgcolor(‘red‘)
turtle.up()
turtle.goto(-300,300)
turtle.down()
for j in range(6):
turtle.begin_fill()
for i in range(5):
turtle.forward(100)
turtle.right(144)
turtle.end_fill()
turtle.up()
turtle.goto(-300+(j*100),300-(j*80))
turtle.down()
标签:半径 基础练习 down 黄色 forward color extent col 同心圆
原文地址:http://www.cnblogs.com/alliancehacker/p/7493017.html