因陀罗

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

1.画一组同切圆

import turtle
turtle.circle(20)
turtle.circle(40)
turtle.circle(60)
turtle.hideturtle()

 

2.画一组同心圆

import turtle
turtle.pos()
turtle.color("blue")
turtle.fillcolor("blue")
turtle.begin_fill()
turtle.circle(20)
turtle.up()
turtle.goto(0,-20)
turtle.down()

turtle.circle(40)
turtle.up()
turtle.goto(0,-40)
turtle.down()

turtle.circle(60)
turtle.end_fill()
turtle.bgcolor("green")
turtle.hideturtle()

 

3.画一个五角星

import turtle

turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)

turtle.hideturtle()

 

4.画一个黄色实心五角星

import turtle
turtle.color("yellow")
turtle.fillcolor("yellow")
turtle.begin_fill()
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.end_fill()


turtle.bgcolor("black")
turtle.hideturtle()

 

5.画左上角的五颗五角星

import turtle
turtle.speed(10)
turtle.up()
turtle.goto(-380,280)
turtle.down()
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.right(144)
turtle.forward(100)
turtle.hideturtle()

turtle.up()
turtle.goto(-250,320)
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.right(144)
turtle.forward(25)
turtle.hideturtle()

turtle.up()
turtle.goto(-220,290)
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.right(144)
turtle.forward(25)
turtle.hideturtle()

turtle.up()
turtle.goto(-220,260)
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.right(144)
turtle.forward(25)
turtle.hideturtle()

turtle.up()
turtle.goto(-250,230)
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.right(144)
turtle.forward(25)
turtle.hideturtle()

 

 

posted on 2017-09-12 11:39  068冯斐然  阅读(246)  评论(0)    收藏  举报