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 turtleSource 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
URL Shortener Using Python Django Introduction: Long URLs can be shortened into short, shareable links with the help of the URL Shortener …
User Authentication System Using Python Django Introduction: The implementation of safe and adaptable user authentication in Django is the main goal of …
The E-Learning System using Java with a Graphical User Interface (GUI) Introduction The E-Learning System is developed using Java (with a Graphical …
Weather App Using Python Django Introduction: When a user enters the name of a city, the Weather App retrieves current weather information. …
Quiz App Using Python Django Introduction: Users can take quizzes in a variety of subjects, see their results, and monitor their progress …
resume screener in python using python introduction The hiring process often begins with reviewing numerous resumes to filter out the most suitable …