VOOZH about

URL: https://www.geeksforgeeks.org/python/draw-rainbow-using-turtle-graphics-in-python/

⇱ Draw Rainbow using Turtle Graphics in Python - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Draw Rainbow using Turtle Graphics in Python

Last Updated : 15 Jul, 2025

Turtle is an inbuilt module in Python. It provides: 

  1. Drawing using a screen (cardboard).
  2. Turtle (pen).

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

Draw Rainbow Using Turtle Graphics

In this section, we will discuss how to draw a Rainbow using two different ways using Turtle Graphics.

Approach: 

  1. Import Turtle.
  2. Set screen
  3. Make Turtle Object
  4. Define colors used for drawing
  5. Loop to draw semi-circles oriented by 180-degree position.

Example 1:

Output:

👁 Rainbow using Turtle Graphics

Example 2:

Output:

Comment
Article Tags:
Article Tags: