from turtle import* def moveto(x,y): penup() goto(x,y) pendown() def main(): setup(800,600) speed(0) for radius in range(20,200,20): moveto(0,-radius) circle(radius) hideturtle() done() if __name__=='__main__': main()
from turtle import * def moveto(x,y): penup() goto(x,y) pendown() def main(): setup(800, 600) speed(0) for radius in range(180, 0, -20): moveto(0, -radius) circle(radius) hideturtle() done() if __name__ == '__main__': main()
from turtle import * from random import random def moveto(x,y): penup() goto(x,y) pendown() def main(): setup(800, 600) speed(0) for radius in range(180, 0, -20): moveto(0, -radius) rgb = tuple(random() for i in range(3)) color(rgb) begin_fill() circle(radius) end_fill() hideturtle() done() if __name__ == '__main__': main()
from turtle import * def square(size=50, rgb = 'orange'): pencolor(rgb) for i in range(4): fd(size) left(90) def main(): setup(800, 600) speed(0) for i in range(3): square(80) left(120) hideturtle() done() if __name__ == '__main__': main()
from turtle import * setup(800, 600) pencolor('pink') for i in range(4): for i in range(2): circle(80, 90) left(90) right(90) hideturtle() done()
from turtle import * speed(0) setup(800, 600) bgcolor('black') pencolor('white') angle = 0 size = 2 for i in range(10): for j in range(4): fd(size) angle += 91 seth(angle) size += 5 hideturtle() done()
from turtle import* from random import random def moveto(x,y): penup() goto(x,y) pendown() def square(size = 50): for i in range(2): fd(0.5*size) left(90) fd(size) left(90) def main(): for x in range(-200,200,20): moveto(x,0) rgb = tuple(random() for i in range(3)) color(rgb) begin_fill() square() end_fill() speed(0) hideturtle() done() if __name__ == '__main__': main()