Print Rainbow Benzene using python with Source Code

In this article we will see how to draw a rainbow Benzene using Python turtle graphics. python have a turtle module. turtle is a popular way for introducing programming to kids.
Print Rainbow Benzene using python
To install the turtle module open your terminal and run the command below
$ python -m pip install turtle
Source Code :
Get Discount on Top Educational Courses
# Importing the Required Module
# pip install turtle
import turtle
# Create window to Display raintbow Benzene
window = turtle.Screen()
# Setting Geomentry for the window
window.setup(600, 600, startx=0, starty=100)
# Colours
colors = ['red', 'purple', 'blue', 'green', 'orange','yellow']
# To draw the rainbow Benzene
t = turtle.Pen()
turtle.bgcolor('black')
for x in range(280):
t. pencolor(colors [x%6])
t.width(x//90 + 1)
t. forward(x)
Output :

Find More Projects
Drawing Chhatrapati Shivaji Maharaj Using Python Chhatrapati Shivaji Maharaj, the legendary Maratha warrior and founder of the Maratha Empire, is an inspiration …
Resume Builder Application using Java With Source Code Graphical User Interface [GUI] Introduction: The Resume Builder Application is a powerful and user-friendly …
Encryption Tool using java with complete source Code GUI Introduction: The Encryption Tool is a Java-based GUI application designed to help users …
Movie Ticket Booking System using Java With Source Code Graphical User Interface [GUI] Introduction: The Movie Ticket Booking System is a Java …
Video Call Website Using HTML, CSS, and JavaScript (Source Code) Introduction Hello friends, welcome to today’s new blog post. Today we have …
promise day using html CSS and JavaScript Introduction Hello all my developers friends my name is Gautam and everyone is welcome to …