![]() |
VOOZH | about |
Turtle is an inbuilt module in Python. It provides:
To draw something on the screen, we need to move the turtle (pen), and to move the turtle, there are some functions like the forward(), backward(), etc.
Prerequisite: Turtle Programming Basics
In this section, we will discuss how to draw a Rainbow using two different ways using Turtle Graphics.
Approach:
- Import Turtle.
- Set screen
- Make Turtle Object
- Define colors used for drawing
- Loop to draw semi-circles oriented by 180-degree position.
Example 1:
Output:
👁 Rainbow using Turtle GraphicsExample 2:
Output: