Ask your own question, for FREE!
Computer Science 8 Online
EpicLeo:

Use what you learned about loops and file versions to create a spirograph picture. Use the starting code below and follow the given steps.

EpicLeo:

main.py: import version2

EpicLeo:

version1.py: # a114_nested_loops_2.py import turtle as trtl color1 = "orange" color2 = "purple" wn = trtl.Screen() width = 400 height = 200 painter = trtl.Turtle() painter.speed(0) painter.color(color1) answer = "y" while (answer == "y"): wn.clearscreen() painter.goto(0,0) space = 1 angle = int(input("angle:")) seg = int(360/angle) answer = input("again? (y/n) --> ") wn.bye()

EpicLeo:

version2.py: # a114_nested_loops_2.py import turtle as trtl color1 = "orange" color2 = "purple" wn = trtl.Screen() width = 400 height = 200 painter = trtl.Turtle() painter.speed(0) painter.color(color1) answer = "y" while (answer == "y"): wn.clearscreen() painter.goto(0,0) space = 1 angle = int(input("angle:")) seg = int(360/angle) while painter.ycor() < height: currentcolor = color1 while painter.ycor() < height: if (currentcolor == color1): currentcolor = color2 else: currentcolor = color1 painter.fillcolor(currentcolor) painter.color(currentcolor) painter.right(angle) painter.forward(2 * space + 10) # experiment painter.begin_fill() painter.circle(3) painter.end_fill() space = space + 1 answer = input("again? (y/n) --> ") wn.bye()

youngtringotringo:

what even is this

EpicLeo:

This is Computer Science - Grade 10

youngtringotringo:

ohhhh nerd work

EpicLeo:

Yes You Make Something Like This # a114_while_guess.py import turtle as trtl # modify with your two favorite colors color1 = "orange" color2 = "purple" color3 = "blue" wn = trtl.Screen() height = 80 # the radius of the shape painter = trtl.Turtle() painter.speed(0) painter.color(color1) space = 1 angle = 90 # experiment with the shape seg = int(360/angle) while (painter.ycor() < height): if (space % 2 == 0): painter.fillcolor(color1) painter.color(color1) elif (space % 2 == 1): painter.fillcolor(color2) painter.color(color2) elif (space % 3 == 1): painter.fillcolor(color3) painter.color(color3) painter.right(angle) painter.forward(2*space + 10) # experiment painter.begin_fill() painter.circle(3) painter.end_fill() space += 1 wn.mainloop()

EpicLeo:

My Class is End in A Few Minute When You Get the Answer Write it Down I Will Check Later

youngtringotringo:

yup i got the answer

EpicLeo:

Did You Create a Spirograph ?

youngtringotringo:

yee

EpicLeo:

You Should Put it Here

youngtringotringo:

yee

EpicLeo:

Class End in One Minute So I am Have to Leave Now

youngtringotringo:

my mom says i cant send it

EpicLeo:

Oh

youngtringotringo:

jk

EpicLeo:

What is That Means

youngtringotringo:

just killing

EpicLeo:

Oh

youngtringotringo:

yeah im just killing

EpicLeo:

Class End Now I am Leave

youngtringotringo:

k sending the anser

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!