标签:circle forward port yellow begin 基础 黄色 imp goto
1.画一组同切圆
import turtle
turtle.circle(20)
turtle.circle(40)
turtle.circle(60)
2.画一组同心圆
r=0
while(r<100):
turtle.up()
turtle.goto(0,-20-r)
turtle.down()
turtle.circle(20+r)
r=r+20
3.画一个五角星
import turtle
for i in range(5):
turtle.forward(50);
turtle.right(144);
4.画一个黄色实心五角星
import turtle
turtle.color(‘yellow‘)
turtle.begin_fill()
turtle.fillcolor(‘yellow‘)
for i in range(5):
turtle.forward(50);
turtle.right(144);
turtle.end_fill()
标签:circle forward port yellow begin 基础 黄色 imp goto
原文地址:http://www.cnblogs.com/yishhaoo/p/7495112.html