Python Programming - Standard Libraries - Discussion

Discussion Forum : Standard Libraries - General Questions (Q.No. 85)
85.
How can you use the turtle module in Python to draw a square?
turtle.draw_square()
turtle.square()
turtle.forward(100); turtle.right(90); turtle.forward(100); turtle.right(90); turtle.forward(100); turtle.right(90); turtle.forward(100)
turtle.draw('square')
Answer: Option
Explanation:
import turtle

# Example usage of turtle module for drawing a square
for _ in range(4):
    turtle.forward(100)
    turtle.right(90)

turtle.done()
Discussion:
Be the first person to comment on this question !

Post your comments here:

Your comments will be displayed after verification.