turtle库基础练习
1画一组同切圆
 import turtle
 turtle.circle(10)
 turtle.circle(30)
turtle.circle(80)
2画一组同心圆
import turtle
 turtle.circle(10)
 turtle.up()
 turtle.goto(0,-20)
 turtle.down()
 turtle.circle(30)
 turtle.up()
 turtle.goto(0,-40)
 turtle.down()
turtle.circle(50)
3画一个五角星
import turtle
>>> turtle.fillcolor('yellow')
>>> turtle.begin_fill()
>>> turtle.forward(50)
>>> turtle.right(144)
>>> turtle.forward(50)
>>> turtle.right(144)
>>> turtle.forward(50)
>>> turtle.right(144)
>>> turtle.forward(50)
>>> turtle.right(144)
>>> turtle.forward(50)
>>> turtle.end_fill()
4画一个黄色实心五角星
import turtle
turtle.color ('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.forward(50)
turtle.right(144)
turtle.forward(50)
turtle.right(144)
turtle.forward(50)
turtle.right(144)
turtle.forward(50)
turtle.right(144)
turtle.forward(50)
turtle.end_fill()
 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号