Skip to main content

Python Turtle Programs : Attractive Shell Design using Python

 Python Turtle

Create a Shell like design using Python turtle.

Code :

"""
Program to create a shell structure
Source : CODE PROBLEM (Youtube)
"""

import turtle
trt= turtle.Turtle() # create turtle object
scr = turtle.Screen() # create screen object
scr.bgcolor('black')
colors = ['red', 'orange', 'yellow','green', 'blue', 'indigo', 'violet','skyblue']
trt.pensize(3) # set the width of the drawing pen
trt.speed(0) # the fastest speed
dis = 292 # initial value

for c in colors: # using different colors at each iteration
trt.color(c)
for j in range(9):
trt.left(10)
for i in range(3):
trt.forward(dis)
trt.left(119)
dis -= 4

trt.hideturtle() # hiding the turtle after the completion of the drawing
turtle.done() # for holding the screen

Output :


Watch Video :Python Shell Design





Comments