4. What will be the output of the following program? import turtle a = turtle.Turtled b = turtle.Turtle c = turtle. Turtle def square(): for i in range(4): a.forward(100) a.left(90) def triangle(): for i in range(3): b.forward(50) b.left(120) squared b.goto(0,100) triangle b.goto(50,100) triangle() c.goto(50,0) c.circle(50)
Attachments:
Answers
Answered by
3
Answer:
turtle is a Python library that enables users to create pictures and shapes by providing them with a virtual canvas. The onscreen pen that you use for drawing is called the turtle and this is what gives the library its name.
Answered by
1
Explanation:
4. What will be the output of the following program? import turtle a = turtle.Turtled b = turtle.Turtle c = turtle. Turtle def square(): for i in range(4): a.forward(100) a.left(90) def triangle(): for i in range(3): b.forward(50) b.left(120) squared b.goto(0,100) triangle b.goto(50,100) triangle() c.goto(50,0) c.circle(50)
Similar questions