I have this code and I tried to do a flowchart but I have no clue how to make one. All of my Flowchart I made, don't make any sense.
Could anyone of you guys please help me out???
import turtle
STARTING_X, STARTING_Y = 350, 200
turtle.penup()
turtle.width(2)
turtle.setheading(180)
turtle.sety(STARTING_Y)
for a in range(1, 8):
turtle.penup()
turtle.setx(STARTING_X)
for b in range(a):
turtle.pendown()
turtle.circle(25)
turtle.penup()
turtle.forward(60)
turtle.sety(turtle.ycor() - 60)
turtle.done()
The code:
# part 1
import turtle
STARTING_X, STARTING_Y = 350, 200
turtle.penup()
turtle.width(2)
turtle.setheading(180)
turtle.sety(STARTING_Y)
# part 2
for a in range(1, 8):
turtle.penup()
turtle.setx(STARTING_X)
for b in range(a): # part 3
turtle.pendown()
turtle.circle(25)
turtle.penup()
turtle.forward(60)
turtle.sety(turtle.ycor() - 60)
turtle.done()
Part 1:
Part 2:
Part 3:
runs a
times
turtle pendown (drawing)
drawing a circle
turtle penup (not drawing)
go forward with 60 (in this case, lower the x position with 60 because of the direction in part 1)
* ** *** **** ***** ****** ******* ********
But circles instead of stars
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.