Ganpati drawing in python
import turtleimport randomturtle.speed(9)turtle.pensize(3)turtle.showturtle()turtle.bgcolor("black")turtle.pencolor("red")def myPosition(x,y): turtle.penup() turtle.goto(x,y) turtle.pendown()myPosition(-13,170)turtle.forward(50)turtle.left(90)turtle.forward(10)turtle.left(90)turtle.forward(100)turtle.left(90)turtle.forward(10)turtle.left(90)turtle.forward(50)turtle.pencolor("darkorange")myPosition(-13,185)turtle.forward(35)turtle.left(90)turtle.forward(10)turtle.left(90)turtle.forward(70)turtle.left(90)turtle.forward(10)turtle.left(90)turtle.forward(35)turtle.pencolor("gold")myPosition(-13,200)turtle.forward(25)turtle.left(90)turtle.forward(10)turtle.left(90)turtle.forward(50)turtle.left(90)turtle.forward(10)turtle.left(90)turtle.forward(25)turtle.pencolor("yellow")myPosition(-13,215)turtle.pencolor("red")for i in range(12): turtle.forward(5) turtle.left(30)myPosition(-13,160)turtle.right(90)turtle.left(15)turtle.forward(10)turtle.right(15)turtle.forward(15)turtle.right(15)turtle.forward(10)turtle.left(15)turtle.right(165)turtle.forward(10)turtle.right(15)turtle.forward(15)turtle.right(15)turtle.forward(10)turtle.left(15)turtle.pencolor("gold")myPosition(-20,-180)turtle.left(90)for i in range(7): turtle.right(20) turtle.forward(20)turtle.forward(10)turtle.left(5)turtle.forward(5)turtle.left(5)turtle.forward(10)turtle.left(5)turtle.forward(15)turtle.left(30)turtle.forward(10)turtle.left(5)turtle.forward(10)for i in range(2): turtle.left(20) turtle.forward(6)turtle.right(20)turtle.forward(60)turtle.left(100)turtle.forward(20)for i in range(8): turtle.right(20) turtle.forward(1)turtle.forward(20)turtle.left(50)turtle.forward(30)for i in range(4): turtle.left(20) turtle.forward(10)turtle.forward(20)turtle.left(95)turtle.forward(50)turtle.right(155)turtle.forward(80)turtle.right(120)turtle.forward(80)for i in range(4): turtle.right(20) turtle.forward(15)turtle.forward(25)turtle.right(30)turtle.forward(5)turtle.left(150)turtle.forward(5)turtle.right(118)turtle.forward(80)for i in range(3): turtle.right(20) turtle.forward(20)turtle.forward(20)for i in range(4): turtle.left(24) turtle.forward(25)myPosition(-1,-130)turtle.left(15)for i in range(7): turtle.right(30) turtle.forward(10)turtle.left(8)for i in range(4): turtle.right(24) turtle.forward(20)for i in range(3): turtle.left(20) turtle.forward(25)turtle.left(10)turtle.forward(60)turtle.right(20)turtle.forward(50)for i in range(3): turtle.right(22) turtle.forward(15)turtle.right(15)turtle.forward(55)turtle.right(105)turtle.forward(70)turtle.right(160)turtle.forward(50)turtle.left(80)turtle.forward(20)for i in range(3): turtle.left(23) turtle.forward(15)turtle.left(3)turtle.forward(20)turtle.left(90)turtle.forward(20)for i in range(3): turtle.right(50) turtle.forward(3)turtle.forward(15)turtle.left(90)turtle.forward(60)for i in range(4): turtle.right(10) turtle.forward(15)turtle.forward(23)turtle.right(15)turtle.forward(5)turtle.right(15)turtle.forward(8)for i in range(6): turtle.left(15) turtle.forward(10)turtle.left(160)turtle.forward(20)turtle.right(40)turtle.forward(5)for i in range(5): turtle.right(20) turtle.forward(5)turtle.forward(10)myPosition(-330,-250)turtle.pencolor("red")turtle.write('Happy Ganesh Chaturthi', font=("Bradley Hand ITC", 50, "bold"))turtle.dotturtle.done()
Output:-
import turtle
import random
turtle.speed(9)
turtle.pensize(3)
turtle.showturtle()
turtle.bgcolor("black")
turtle.pencolor("red")
def myPosition(x,y):
turtle.penup()
turtle.goto(x,y)
turtle.pendown()
myPosition(-13,170)
turtle.forward(50)
turtle.left(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(100)
turtle.left(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(50)
turtle.pencolor("darkorange")
myPosition(-13,185)
turtle.forward(35)
turtle.left(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(70)
turtle.left(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(35)
turtle.pencolor("gold")
myPosition(-13,200)
turtle.forward(25)
turtle.left(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(50)
turtle.left(90)
turtle.forward(10)
turtle.left(90)
turtle.forward(25)
turtle.pencolor("yellow")
myPosition(-13,215)
turtle.pencolor("red")
for i in range(12):
turtle.forward(5)
turtle.left(30)
myPosition(-13,160)
turtle.right(90)
turtle.left(15)
turtle.forward(10)
turtle.right(15)
turtle.forward(15)
turtle.right(15)
turtle.forward(10)
turtle.left(15)
turtle.right(165)
turtle.forward(10)
turtle.right(15)
turtle.forward(15)
turtle.right(15)
turtle.forward(10)
turtle.left(15)
turtle.pencolor("gold")
myPosition(-20,-180)
turtle.left(90)
for i in range(7):
turtle.right(20)
turtle.forward(20)
turtle.forward(10)
turtle.left(5)
turtle.forward(5)
turtle.left(5)
turtle.forward(10)
turtle.left(5)
turtle.forward(15)
turtle.left(30)
turtle.forward(10)
turtle.left(5)
turtle.forward(10)
for i in range(2):
turtle.left(20)
turtle.forward(6)
turtle.right(20)
turtle.forward(60)
turtle.left(100)
turtle.forward(20)
for i in range(8):
turtle.right(20)
turtle.forward(1)
turtle.forward(20)
turtle.left(50)
turtle.forward(30)
for i in range(4):
turtle.left(20)
turtle.forward(10)
turtle.forward(20)
turtle.left(95)
turtle.forward(50)
turtle.right(155)
turtle.forward(80)
turtle.right(120)
turtle.forward(80)
for i in range(4):
turtle.right(20)
turtle.forward(15)
turtle.forward(25)
turtle.right(30)
turtle.forward(5)
turtle.left(150)
turtle.forward(5)
turtle.right(118)
turtle.forward(80)
for i in range(3):
turtle.right(20)
turtle.forward(20)
turtle.forward(20)
for i in range(4):
turtle.left(24)
turtle.forward(25)
myPosition(-1,-130)
turtle.left(15)
for i in range(7):
turtle.right(30)
turtle.forward(10)
turtle.left(8)
for i in range(4):
turtle.right(24)
turtle.forward(20)
for i in range(3):
turtle.left(20)
turtle.forward(25)
turtle.left(10)
turtle.forward(60)
turtle.right(20)
turtle.forward(50)
for i in range(3):
turtle.right(22)
turtle.forward(15)
turtle.right(15)
turtle.forward(55)
turtle.right(105)
turtle.forward(70)
turtle.right(160)
turtle.forward(50)
turtle.left(80)
turtle.forward(20)
for i in range(3):
turtle.left(23)
turtle.forward(15)
turtle.left(3)
turtle.forward(20)
turtle.left(90)
turtle.forward(20)
for i in range(3):
turtle.right(50)
turtle.forward(3)
turtle.forward(15)
turtle.left(90)
turtle.forward(60)
for i in range(4):
turtle.right(10)
turtle.forward(15)
turtle.forward(23)
turtle.right(15)
turtle.forward(5)
turtle.right(15)
turtle.forward(8)
for i in range(6):
turtle.left(15)
turtle.forward(10)
turtle.left(160)
turtle.forward(20)
turtle.right(40)
turtle.forward(5)
for i in range(5):
turtle.right(20)
turtle.forward(5)
turtle.forward(10)
myPosition(-330,-250)
turtle.pencolor("red")
turtle.write('Happy Ganesh Chaturthi', font=("Bradley Hand ITC", 50, "bold"))
turtle.dot
turtle.done()
Comments
Post a Comment