Knowee
Questions
Features
Study Tools

Select the correct answerWhat will be the output of the following Python code?import turtle as ttfor k in range(0,4): tt.forward(200) tt.left(90) tt.penup()tt.left(90)tt.forward(200)for a in range(0,4): tt.forward(100) tt.left(90)OptionsError2 squares, at a separation of 100 units, without a line joining them2 squares, at a separation of100 units, joined by a straight line1 square

Question

Select the correct answerWhat will be the output of the following Python code?import turtle as ttfor k in range(0,4): tt.forward(200) tt.left(90) tt.penup()tt.left(90)tt.forward(200)for a in range(0,4): tt.forward(100) tt.left(90)OptionsError2 squares, at a separation of 100 units, without a line joining them2 squares, at a separation of100 units, joined by a straight line1 square

🧐 Not the exact question you are looking for?Go ask a question

Solution

2 squares, at a separation of 100 units, without a line joining them

Similar Questions

Select the correct answerWhat will be the output of the following Python code?import turtle as tttt.goto(500,10)tt.position()Options10, 500500, 1010.00, 500.00500.00, 10.00

Test time left: 54:11Select the correct answerWhat will be the output of the following Python code?import turtle as tttt.goto(500,10)tt.position()Options10, 50010.00, 500.00500.00, 10.00500, 10

Which of the following is NOT an example of a built-in function in Python Turtle programming?(1 Point)print( )range( )draw_circle( )len( )

Soit le code suivant :1. from turtle import *2.3. def avancer_sans_tracer(d) :4. up()5. forward(d)6. down()7.8. def figure_simple(cote):9. forward(cote/2)10. right(90)11. i = 112. while i <= 3 :13. forward(cote)14. right(90)15. i = i + 116. forward(cote/2)17. def figure_composee(taille):18. i = 019. while i < 4 :20. figure_simple(taille)21. left(90)22. i = i + 123.24. if __name__=="__main__":25. up()26. goto(-70,20)27. down()28. dim = 4029. i = 030. while i <= 1 :31. figure_composee(dim)32. avancer_sans_tracer(2*dim+10)33. i = i + 11. Quelle figure géométrique est tracée si on appelle la fonction figure_simple ?2. A l’appel de la fonction figure_composee, combien de fois est appelée la fonction figure_simple ?3. A l’exécution du programme principal (c’est-à-dire , les instructions qui suivent l’instruction if __name__=="__main__"),combien de fois est appelée la fonction figure_composee ?4. Sur la feuille de réponse, reproduire le dessin obtenu. Les carreaux sont de taille 10×10. Les lignes en pointillés sur lafeuille réponse correspondent à l’axe des abscisses et ordonnées. Initialement, le curseur est en (0,0) et orienté vers ladroite.5. Sur la feuille de réponse, dessiner le curseur dans sa position finale. On demande de le dessiner sous la même forme quele curseur déjà présent à sa position initiale. Il faudra le placer à la bonne position et l’orienter dans la bonne direction.

Write a function called square that takes a parameter named t, which is a turtle. Itshould use the turtle to draw a square.Write a function call that passes bob as an argument to square, and then run theprogram again.2. Add another parameter, named length, to square. Modify the body so length of thesides is length, and then modify the function call to provide a second argument. Runthe program again. Test your program with a range of values for length.3. Make a copy of square and change the name to polygon. Add another parameternamed n and modify the body so it draws an n-sided regular polygon. Hint: Theexterior angles of an n-sided regular polygon are 360/n degrees.4. Write a function called circle that takes a turtle, t, and radius, r, as parameters andthat draws an approximate circle by calling polygon with an appropriate length andnumber of sides. Test your function with a range of values of r.Hint: figure out the circumference of the circle and make sure that length * n =circumference.5. Make a more general version of circle called arc that takes an additional parameterangle, which determines what fraction of a circle to draw. angle is in units of degrees,so when angle=360, arc should draw a complete circle.

1/2

Upgrade your grade with Knowee

Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.