Turtle in python

 Firstly install Turtle by typing in terminal : pip install pythonturtle

And then run code

# Python program to draw
# Rainbow Benzene
# using Turtle Programming
import turtle
colors = ['red', 'purple', 'blue', 'green', 'orange', 'yellow']
t = turtle.Pen()
turtle.bgcolor('black')
for x in range(360):
t.pencolor(colors[x%6])
t.width(x/100 + 1)
t.forward(x)
t.left(59)

Comments

Popular posts from this blog

IO BASIC

Y.T Videos downloader [Python]

Convert PDF To Audiobook [Without Python]