import os import turtle os.chdir(r'D:\projects\wordpress\ex56') os.getcwd() def draw_diamond(some_turtle): some_turtle.left(30) some_turtle.forward(200) some_turtle.right(60) some_turtle.forward(200) some_turtle.right(120) some_turtle.forward(200) some_turtle.right(60) some_turtle.forward(200) some_turtle.right(150) def draw_art(): window = turtle.Screen() window.bgcolor("white") brad = turtle.Turtle() brad.color("blue") brad.speed(0) # Draw a circle with 36 diamonds. We rotate each diamond by 10 degrees at a time. for i in range (0, 36): draw_diamond(brad) brad.right(10) window.exitonclick() # click on the window to exit draw_art() turtle.mainloop()
Recent Comments