mirror of
https://github.com/metafy-social/python-scripts.git
synced 2025-01-18 07:17:03 +00:00
Create Design1.py
Color Changing Pattern using Turtle
This commit is contained in:
parent
e37961483b
commit
1b4dbcbf2a
21
scripts/Turtle Graphics/Design1.py
Normal file
21
scripts/Turtle Graphics/Design1.py
Normal file
|
@ -0,0 +1,21 @@
|
||||||
|
import turtle as t
|
||||||
|
|
||||||
|
t.bgcolor("black")
|
||||||
|
t.speed(0)
|
||||||
|
t.pensize(2)
|
||||||
|
|
||||||
|
colors=['red','yellow','blue','purple','green','#fe019a','black','white','red','yellow','blue','purple','green','#fe019a','black','white']
|
||||||
|
|
||||||
|
distance=170
|
||||||
|
t.hideturtle()
|
||||||
|
|
||||||
|
for color in colors:
|
||||||
|
t.color(color)
|
||||||
|
for j in range(8):
|
||||||
|
t.left(45)
|
||||||
|
for i in range (2):
|
||||||
|
t.forward(distance)
|
||||||
|
t.left(60)
|
||||||
|
t.forward(distance)
|
||||||
|
t.left(120)
|
||||||
|
t.done()
|
Loading…
Reference in New Issue
Block a user