turtle库基础练习

画一组同切圆

import turtle
turtle.circle(50)
turtle.circle(60)
turtle.circle(70)
turtle.circle(80)

画一组同心圆

import turtle
turtle.circle(60)
turtle.up()
turtle.goto(65,0)
turtle.goto(0,0)
turtle.goto(-10,0)
turtle.goto(0,0)
turtle.goto(0,-20)
turtle.down()
turtle.circle(80)
turtle.up()
turtle.goto(0,-40)
turtle.down()
turtle.circle(100)

画一个五角星

import turtle
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)

画一个黄色实心五角星

import turtle
turtle.bgcolor('red')
turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)

turtle.end_fill()

红旗

import turtle
turtle.bgcolor('red')
turtle.up()
turtle.goto(-250,200)
turtle.down()

turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.right(144)
turtle.forward(60)
turtle.end_fill()


turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-150,250)
turtle.left(30)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()


turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-130,220)
turtle.left(60)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()

turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-110,170)
turtle.left(60)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()

turtle.color('yellow')
turtle.fillcolor('yellow')
turtle.begin_fill()
turtle.up()
turtle.goto(-160,108)
turtle.left(80)
turtle.down()
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.right(144)
turtle.forward(25)
turtle.end_fill()






posted @ 2017-09-08 09:54  044潘育珊  阅读(93)  评论(0编辑  收藏  举报