Let’s have more fun and see how to create a wheel with Python. We will use the Turtle module.
How to create a wheel?
To draw a simple wheel, just use the below code:
import turtle turtle.circle(100) turtle.mainloop()

But let’s have even more fun and draw more wheels.
How to create two wheels?
This code will draw two wheels.
import turtle turtle.circle(100) turtle.circle(-100) turtle.mainloop()
To draw a wheel backwards, just use the below code. It draws backwards thanks to using -360 as a second argument in the circle function. By lowering the 360 number, you can draw only a part of the wheel.
import turtle turtle.circle(100, -360) turtle.mainloop()
How to create a dotted line wheel?
Now let’s use the dotted line. This is how to draw a wheel with a dotted line.
import turtle for i in range(12): turtle.circle(100, 15) turtle.penup() turtle.circle(100, 15) turtle.pendown() turtle.mainloop()
I used a simple for loop and penup and pendown functions.
How to create a black wheel?
The next wheel will be filled in. This is the black wheel.
import turtle turtle.begin_fill() turtle.circle(100) turtle.end_fill() turtle.mainloop()

How to create a purple wheel?
Why not draw a black one? Let’s change the color! This is the purple wheel.
import turtle turtle.fillcolor('purple') turtle.begin_fill() turtle.circle(100) turtle.end_fill() turtle.mainloop()

Draw a whell with a border
Of course, you can use another color. The code is self explanatory. Just write the other color into the Python code.
Oh, you haven’t just changed your mind? What do you mean you like the black one and you also like purple? I have an idea! Let’s add a border to the wheel and make it purple with a black border.
import turtle turtle.pensize(20) turtle.color('black') turtle.fillcolor('purple') turtle.begin_fill() turtle.circle(100) turtle.end_fill() turtle.mainloop()

Now you know how to create a wheel with Python Turtle. Please check more Python Turle drawnings.