cool python turtle design with source code | Python Turtle Beautiful Design | python turtle pattern code | python turtle animation

Share

cool python turtle design with source code | Python Turtle Beautiful Design

Video

python turtle codes to copy

Source Code

from turtle import *
from random import *
from time import sleep
screen = Screen()
screen.setup(width = 1.0, height = 1.0)
colormode(255)

def color():
    r=randint(0,255)
    g=randint(0,255)
    b=randint(0,255)
    return r,g,b
pensize(2)
speed('fastest')

def sq(s=80):
    for i in range(4):
        fd(s)
        lt(90)
def pentagon():
    for i in range(5):
       forward(100) #Assuming the side of a pentagon is 100 units
       right(72) #Turning the turtle by 72 degree

def startposition():
    penup()
    goto(0,0)
    pendown()


radius=181
def p02():
    pencolor(color())
    def p01():
        for i in range (25):
            global radius
            radius-=3
            if radius>0:
                circle(radius)
        radius=181    
    for u in range(10):
        p01()
        lt(36)
        
        
p02()
sleep(2)
clear()
startposition()


def p2():
    for i in range (70):
        pencolor(color())
        sq()
        lt(90)
        penup()
        fd(i*10)
        pendown()
        

p2()
sleep(1.8)
clear()
startposition()
def p3():
    for i in range (70):
        r=randint(0,255)
        g=randint(0,255)
        b=randint(0,255)
        pencolor(b,g,r)
        fillcolor(b,g,r)
        begin_fill()
        sq()
        end_fill()
        lt(90)
        penup()
        fd(i*10)
        pendown()


p3()
sleep(1)
clear()
startposition()




def p4():
    for i in range (50):
        pencolor(color())
        pentagon()
        lt(90)
        penup()
        fd(i*10)
        pendown()

p4()
sleep(1)
clear()
startposition()

def p5():
    for i in range (50):
        r=randint(0,255)
        g=randint(0,255)
        b=randint(0,255)
        pencolor(b,g,r)
        fillcolor(b,g,r)
        begin_fill()
        pentagon()
        end_fill()
        lt(90)
        penup()
        fd(i*10)
        pendown()

p5()
sleep(1)
clear()
startposition()

def p6():
    for i in range (20):
        r=randint(0,255)
        g=randint(0,255)
        b=randint(0,255)
        pencolor(b,g,r)
        fillcolor(b,g,r)
        begin_fill()
        pentagon()
        end_fill()
        lt(i)

p6()
clear()
pensize(3)
startposition()

def p7():
    for i in range (120):
        pencolor(color())
        circle(i,180)
        lt(45)

p7()
sleep(1)
clear()
startposition()


def p8():
    for i in range (100):
        pencolor(color())
        circle(i,180)
        lt(90)

p8()
sleep(1)
clear()
startposition()

def p9():
    for i in range (80):
        r=randint(0,255)
        g=randint(0,255)
        b=randint(0,255)
        pencolor(r,g,b)
        circle(i*3,180)
        sq()
        
p9()
sleep(1)
clear()
startposition()
def p0():
    for i in range (60):
        pencolor(color())
        pentagon()
        lt(i)
        
p0()
sleep(1)
clear()
startposition()

def p01():
    for i in range (80):
        pencolor(color())
        sq(s=100)
        
        lt(12)
        
p01()
sleep(1)


Share
Related  QGPT Quiz website project in php

Leave a Reply

Your email address will not be published. Required fields are marked *

Top 5 Most Expensive Domains Ever Sold 4 Must-Try ChatGPT Alternatives: Perplexity AI, BardAI, Pi, and More! Types of Trading Techniques in the Stock Market. ChatGPT app now available in India this AI chatbot can help you make your life more productive. What is wrong with following function code?