标签:bre begin 条件 end down 分享 style goto pre
import turtle #五角星 turtle.color(‘yellow‘) turtle.begin_fill() for i in range(5): turtle.forward(100) turtle.right(144) turtle.end_fill()
import turtle #同心圆 def tongxinyuan(r): for i in range(5): turtle.penup() turtle.goto(0,-50*(i+1)) turtle.pendown() turtle.circle(r*(i+1)) tongxinyuan(50)
import turtle #太阳花 turtle.bgcolor(‘black‘) turtle.color(‘gray‘,‘white‘) turtle.speed("fastest") turtle.begin_fill() while True: turtle.forward(250) turtle.left(155) if abs(turtle.pos())<1: break turtle.end_fill() turtle.done()
import turtle #五个五角星 turtle.bgcolor(‘red‘) turtle.color(‘yellow‘) #画一个五角星 def wujiaoxin1(x,y): turtle.begin_fill() for i in range(5): turtle.forward(x) turtle.right(y) turtle.end_fill() def wujiaoxin2(x,y): turtle.begin_fill() for i in range(5): turtle.forward(x) turtle.left(y) turtle.end_fill() #定义坐标 def zuobiao(x,y): turtle.up() turtle.goto(x,y) turtle.down() zuobiao(-330,190) wujiaoxin1(100,144) zuobiao(-190,250) wujiaoxin2(50,144) zuobiao(-150,170) wujiaoxin2(50,144) zuobiao(-150,110) wujiaoxin1(50,144) zuobiao(-190,20) wujiaoxin2(50,144)
import turtle turtle.bgcolor(‘black‘) turtle.color(‘gray‘,‘black‘) turtle.speed("fastest") turtle.begin_fill() for i in range(73): turtle.forward(150) turtle.left(45) turtle.forward(150) turtle.left(135) turtle.forward(150) turtle.left(45) turtle.forward(150) turtle.left(135) turtle.left(5) turtle.end_fill()
标签:bre begin 条件 end down 分享 style goto pre
原文地址:http://www.cnblogs.com/wgd0069/p/7516401.html