首页 > 其他 > 详细

turtle 库练习

时间:2017-09-12 14:57:33      阅读:306      评论:0      收藏:0      [点我收藏+]
#同切圆
import turtle
turtle.circle(10)
 

turtle.circle(20)
turtle.circle(30)
turtle.circle(40)
turtle.circle(50)
turtle.circle(60)
turtle.circle(70)
turtle.circle(80)

import turtle
#同心圆
turtle.circle(10)
turtle.penup()
turtle.goto(0,-10)
turtle.pendown()
turtle.circle(20)
turtle.penup()
turtle.goto(0,-20)
turtle.pendown()
turtle.circle(30)
turtle.penup()
turtle.goto(0,-30)
turtle.pendown()
turtle.circle(40)
turtle.penup()
turtle.goto(0,-40)
turtle.pendown()
turtle.circle(50)
turtle.penup()
turtle.goto(0,-50)
turtle.pendown()
turtle.circle(60)
turtle.penup()
turtle.goto(0,-60)
turtle.pendown()
turtle.circle(70)
turtle.penup()
turtle.goto(0,-70)
turtle.pendown()
turtle.circle(80)
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)
#黄色五角星
import turtle
turtle.color(yellow)
turtle.bgcolor(red)

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.end_fill()
#国旗
import turtle
turtle.color(yellow)
turtle.bgcolor(red)

#大五角星
turtle.penup()
turtle.goto(-350,210)
turtle.penup()
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.end_fill()

#四个小五角星
turtle.begin_fill()
turtle.penup()
turtle.goto(-180,270)
turtle.pendown()
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()

turtle.begin_fill()
turtle.penup()
turtle.goto(-100,245)
turtle.pendown()
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()


turtle.begin_fill()
turtle.penup()
turtle.goto(-110,95)
turtle.pendown()
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()

turtle.begin_fill()
turtle.penup()
turtle.goto(-170,50)
turtle.pendown()
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()

技术分享技术分享技术分享技术分享技术分享

 

turtle 库练习

原文:http://www.cnblogs.com/wgd0069/p/7509631.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!