Home /
Expert Answers /
Computer Science /
example-3-drawing-a-square-using-loops-do-you-know-what-else-was-boring-the-fact-that-i-had-to-pa847
(Solved): Example 3: Drawing a square (using loops) Do you know what else was boring? The fact that I had to ...
Example 3: Drawing a square (using loops) Do you know what else was boring? The fact that I had to copy-paste the same ecact lass of code 4 tines in a ron. Wouldn't it be great if we could just tell Pythoe to repeat the code for us? Code inport turtie saart - turtie-Turtlet) e ofndentede by four apaces. for t in range (a)1 snart. forkardise) swart rightige) tartle.done() Expected Output Additional notes What do you think will happen if you run she following code? print!"start test") for 1 in ramge (4): print(1) print("test") print ("end teit t") for banara in range [2 e) print(bansta) print (banana * 2) Example 4 Spiraling star Code Expected Output inport turtie spirat - turtle.Turtheis for 1 in range (20) : spirsi.forwardli * a) spiraliright (144) turtle.donel| Additional notes Notice that now l'm moving the turtle forward by a different amount each time What happena if instead of multiplying f by 10,1 multiply it against itsel?? What if Ido spiral. forward [1?1) instead?