Home > Article > Backend Development > How to draw a circle using python
How to draw a circle in python? Here are the specific painting steps:
The first step is to click on the menu bar and enter idle.
The second step is to open the shell, create a new file and name it.
Related recommendations: "Python Video Tutorial"
The third step is to import the turtle module and start writing code.
The code is as follows:
import turtle
turtle.color('red') #Set the color of the brush
turtle.pensize(3 ) #Set the size of the brush
turtle.circle(100) #Set the size of the circle
turtle.done()
The fourth step is to show the rendering.
The above is the detailed content of How to draw a circle using python. For more information, please follow other related articles on the PHP Chinese website!