import turtle
num_of_lines = 6
line_length = 100
angle = 360 / num_of_lines
turtle.penup()
turtle.goto(0, 0)
turtle.pendown()
for i in range(num_of_lines):
turtle.forward(line_length)
turtle.backward(line_length)
turtle.right(angle)
turtle.done()
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
import turtle
num_of_lines = 6
line_length = 100
angle = 360 / num_of_lines
turtle.penup()
turtle.goto(0, 0)
turtle.pendown()
for i in range(num_of_lines):
turtle.forward(line_length)
turtle.backward(line_length)
turtle.right(angle)
turtle.done()