Turtle 3D cubes

import turtle

screen=turtle.Screen()  

screen.setup(800,800)   

trtl = turtle.Turtle()

screen.title("3-D CUBES")

trtl.penup()

trtl.setposition(0,0)

trtl.setheading(90)

trtl.color('red')

def hexagon():

    for i in range(6):

        trtl.fd(50)

        trtl.rt(60)

i = 1

while i < 7:

    trtl.pendown()

    hexagon()

    trtl.right(60)

    i = i + 1 

No comments: