neex
4/25/2017 - 5:09 AM

Studio 4

Studio 4

import turtle

def main():
    window = turtle.Screen()
    window.bgcolor("green")
    
    alex = turtle.Turtle()
    alex.speed(0)
    alex.color("blue")
    alex.pensize(2)
    
    draw_shape(alex, 100, 40)
    
    window.exitonclick()
    
def draw_square(turtle, length):
    for i in range(4):
        turtle.forward(length)
        turtle.right(90)

def draw_shape(turtle, length, shape_number):
    angle = 360 / shape_number
    for i in range(shape_number):
        draw_square(turtle, length)
        turtle.right(angle)

main()