标签:forward range 国际 tle else black fill for done
import turtle turtle.speed(30) turtle.penup() off = True for y in range(-40, 30 + 1, 10): for x in range(-40, 30 + 1, 10): if off: turtle.goto(x, y) turtle.pendown() turtle.begin_fill() turtle.color("black") turtle.forward(10) turtle.left(90) turtle.forward(10) turtle.left(90) turtle.forward(10) turtle.left(90) turtle.forward(10) turtle.left(90) turtle.end_fill() turtle.penup() else: turtle.goto(x, y) turtle.pendown() turtle.forward(10) turtle.left(90) turtle.forward(10) turtle.left(90) turtle.forward(10) turtle.left(90) turtle.forward(10) turtle.left(90) turtle.penup() off = bool(int(off) - 1) off = bool(int(off) - 1) turtle.hideturtle() turtle.done()
标签:forward range 国际 tle else black fill for done
原文地址:https://www.cnblogs.com/youngTW/p/12467853.html