Python and Turtle Difficulty Level 2,for loop,loop Center Connected Hexagon (Source Code)

Center Connected Hexagon (Source Code)

Draw a regular hexagon that have vertices connected to the center. Use for loop to draw this shape.

Center Connected Hexagon

Source Code:

hideturtle()
for angle in range(0,360,60):
    up()
    goto(0,0)
    seth(angle)
    down()
    fd(300)

up()
goto(300,0)
seth(120)
down()
for _ in range(6):
    fd(300)
    left(60)
Tags:

Related Post