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
resume screener in python using python introduction The hiring process often begins with reviewing numerous resumes to filter out the most suitable …
expense tracer in python using GUI introduction Tracking daily expenses is a vital part of personal financial management. Whether you’re a student …
my personal diary in python using GUI introduction Keeping a personal diary in python is one of the oldest and most effective …
interview question app in python using GUI introduction In today’s rapidly evolving tech landscape, landing a job often requires more than just …
sudoko solver in python using GUI introduction Sudoku, a classic combinatorial number-placement puzzle, offers an engaging challenge that blends logic, pattern recognition, …
handwritten digit recognizer in python introduction In an era where artificial intelligence and deep learning are transforming industries, real-time visual recognition has …