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()

example56
 

 

 

Discover more from Tips and Hints for Aerospace Engineers

Subscribe now to keep reading and get access to the full archive.

Continue reading