4/05/2019

Python (Turtle Library)

Python Program (Turtle Library)
Python Program (Turtle Library)
 


import turtle
t=turtle.Turtle()
s=turtle.Screen()
s.bgcolor('white')
t.pencolor('red')
t.speed(0) #change the speed value 
for i in range(45):
    t.circle(190-1,90)
    t.lt(98)
    t.circle(190-1,90)
    t.lt(18)

4/03/2019

Colorful Hexagon in python

Colorful Hexagon in python

 
import turtle
colors=["green","orange","red","blue","purple","yellow"]
t=turtle.pen()
turtle.bgcolor("black")
turtle.speed(0) 
for i in range(250):
    turtle.pencolor(colors[i%6])
    turtle.width(i//100+1)
    turtle.forward(i)
    turtle.left(59)