Python Turtle Graphics se Lord Ganesha ka Chitran Banayein

Turtle graphics ek popular tarika hai jisse programming ke concepts ko beginners ko samjhane ke saath-saath, rochak visualizations banane mei madad milti hai. Is article mein hum dekhenge kaise Python ke turtle graphics ka istemal karke Lord Ganesha ke chehre ka ek mool roop banaya ja sakta hai. Chaliye, step-by-step prakriya ko samjhein.
Python Turtle Graphics se Lord Ganesha ka Chitran Banayein

Python Turtle Graphics se Lord Ganesha ka Chitran Banayein

1. Turtle Graphics ki Introduction:

Turtle graphics ek graphics library hai Python mein jo aapko ek kachua (turtle) ki madad se screen par ek drawing banane ke liye aadesh dene ki anumati deta hai. Kachua aadeshon ka palan karta hai aur aapko drawing banane mei madad karta hai, jo programming ke concepts ko samajhne ka ek rochak aur interactive tarika hai.

2. Environment Set Up:

Shuruwat karne ke liye, hum turtle module ko import karte hain aur chitrakala ka mahol taiyar karte hain. Hum ek turtle object banate hain, uski gati, rang, aur kuch parameters ko set karte hain taaki hum apne jarurat ke anusar picture ko customize kar sakein.

Full Code:

from turtle import *
title("www.programmingkakeeda.com")
bgcolor('#36454f')
speed(4)
pensize(4)
showturtle()
pencolor('#d22b2b')
def myPosition(N,S):
    penup()
    goto(N,S)
    pendown()
myPosition(-13,170)    
forward(50)
left(90)
forward(10)
left(90)
forward(100)
left(90)
forward(10)
left(90)
forward(50)
pencolor('#ffcc00')
myPosition(-13,185)
forward(35)
left(90)
forward(10)
left(90)
forward(70)
left(90)
forward(10)
left(90)
forward(35)
pencolor('#ff3131')
myPosition(-13,200)
forward(25)
left(90)
forward(10)
left(90)
forward(50)
left(90)
forward(10)
left(90)
forward(25)
myPosition(-13,215)
pencolor("#ff5f1f")
for i in range(12):
    forward(5)
    left(30)
myPosition(-13,160)
right(90)
left(15)
forward(10)
right(15)
forward(15)
right(15)
forward(10)
left(15)
right(165)
forward(10)
right(15)
forward(15)
right(15)
forward(10)
left(15)
pencolor("#ffcc00")
myPosition(-20,-180)
left(90)
for i in range(7):
    right(20)
    forward(20)
forward(10)
left(5)
forward(5)
left(5)
forward(10)
left(5)
forward(15)
left(30)
forward(10)
left(5)
forward(10)
for i in range(2):
    left(20)
    forward(6)
right(20)    
forward(60)
left(100)
forward(20)
for i in range(8):
    right(20)
    forward(1)
forward(20)    
left(50)
forward(30)
for i in range(4):
    left(20)
    forward(10)
forward(20)    
left(95)
forward(50)
right(155)
forward(80)
right(120)
forward(80)
for i in range(4):
    right(20)
    forward(15)
forward(25)    
right(30)
forward(5)
left(150)
forward(5)
right(118)
forward(80)
for i in range(3):
    right(20)
    forward(20)
forward(20)    
for i in range(4):
    left(24)
    forward(25)
myPosition(-1,-130)    
left(15)
for i in range(7):
    right(30)
    forward(10)
left(8)    
for i in range(4):
    right(24)
    forward(20)
for i in range(3):
    left(20)    
    forward(25)
left(10)    
forward(60)
right(20)
forward(50)
for i in range(3):
    right(22)
    forward(15)
right(15)    
forward(55)
right(105)
forward(70)
right(160)
forward(50)
left(80)
forward(20)
for i in range(3):
    left(23)
    forward(15)
left(3)    
forward(20)
left(90)
forward(20)
for i in range(3):
    right(50)
    forward(3)
forward(15)    
left(90)
forward(60)
for i in range(4):
    right(10)
    forward(15)
forward(23)    
right(15)
forward(5)
right(15)
forward(8)
for i in range(6):
    left(15)
    forward(10)
left(160)    
forward(20)
right(40)
forward(5)
for i in range(5):
    right(20)
    forward(5)
forward(5)    
myPosition(-330,-250)
pencolor('#ff5f1f')
write('                 Ganpati Bappa Morya', font=('Arial', 25))
done()

Output:

Python Turtle Graphics se Lord Ganesha ka Chitran Banayein
Video link:- Click me
Is blog post mein, humne dekha kaise Python ke turtle graphics ka upyog karke Lord Ganesha ke chehre ka ek sadharan roop banaya ja sakta hai. Turtle graphics ek aisi shaktishali tool hai jo programming ke concepts ko interactive aur rochak tarike se sikhane mein madad karti hai. Hum aapko protsahit karte hain ki aap is mool roop ko modify aur enhance karein, jisse aap apne creativity ko aazmaiye aur turtle graphics ki madat se alag alag design banaye.
Humari Website me aane ke liye apka bahut-bahut Dhanyawaad!

एक टिप्पणी भेजें

0 टिप्पणियाँ
* Please Don't Spam Here. All the Comments are Reviewed by Admin.