Below is an example code to draw a circle using the turtle graphics module in Python:
main.py168 chars12 lines
In the above code, we first import the turtle
module and create a Turtle
object. Then, we create a Screen
object to display the turtle graphics.
Next, we use the circle()
method of the Turtle
object to draw a circle with a radius of 50
units. Finally, we use the exitonclick()
method of the Screen
object to keep the screen active until we click on it.
gistlibby LogSnag