I'm having a hard time creating a program that will draw all of the stars from 3 to 7. The program needs to have:
- The variables numberOfSides, numberOfTrips, firstNumberOfSides, and lastNumberOfSides.
- A series of stars one after the other for 3 to 7 sides
- The screen must clear after each star is fully drawn
- The straight-line segments need to be proportional by numberOfTrips/numberOfSides
So far, all I have is this:
import turtle wn = turtle.Screen() jake = turtle.Turtle() for i in range(3,8): numberOfSides = i numberOfTrips = ((numberOfSides+1)//2-1) for n in range(numberOfSides): jake.forward(100) jake.right(360*numberOfTrips/i) turtle.resetscreen()
I'm especially having a hard time getting all of the shapes to be drawn. I'm missing a pentagon and hexagon.
Edited by sophia_sin