Lord Ram Ka Naam Using Python Turtle, Jay Shree Ram

Python, ek bahut hi badhiya aur powerful programming language hai, vibhin prakar ki libraries ki variety pradan karti hai jo ise beginners aur experienced developers dono ke liye accessible banati hai. Esi hi ek library turtle hai, jo graphics ke madhyam se programming ke concepts ko pesh karne ka ek unique tarika pradan karti hai. Is article mein, hum turtle graphics library ka pata lagaenge aur ek python script ka use karenge jo iska use "Lord Ram Ka Naam Using Python Turtle" likhne me madat karegi.
Lord Ram Ka Naam Using Python Turtle, Jay Shree Ram

Lord Ram Ka Naam Using Python Turtle, Jay Shree Ram

Understanding Turtle Graphics

Turtle graphics beginners logo ko programming se introduce karne ka ek popular tarika hai. Yah screen ke chaaro or ghumne vale virtual "turtle" ka use karke drawing banane ka ek saral aur aakarshak tarika hai. Turtle ko shapes, patterns aur bahut kuch banane ke commands se control kiya ja sakta hai. Turtle graphics library, Python’s standard library ka hissa hai, jisse ise Python install karne vale kisi bhi vyakti ke liye asani se accessible banaya ja sakta hai.

Let’s Code Now

Import the turtle library

from turtle import *
Sabse pehle, hume turtle method ka use karke turtle package ko import karna hoga.

We need to set the screen(), turtle speed, and background-color

title("Programming Ka Keeda")
setup(width=700, height=698)
pencolor("blue")
pensize(5)
bgcolor("black")
speed(10)
Yahan, hum cursor ki speed(10) set karte hain, screen ka size (width=700, height=698) rakte hain, aur background ka color black set karte hain.

Draw Round box

penup()
setpos(-280,340)
pendown()
begin_fill()
fillcolor("darkblue")
for i in range(4):
    forward(500)
    circle(-30,90)
end_fill()

Draw a big Circle

penup()
goto(0,-110)
pendown()
pensize(5)
pencolor("red")
begin_fill()
fillcolor("darkorange")
circle(180,360)
end_fill()
Sabse pehle, hum pen ko set karne ke liye alag-alag function ka use karte hain aur hum box ke andar ek circle aakar draw karte hai aur circle ka color set karne ke liye hum begin_fill aur end_fill function ka use karte hain.

Draw Clouds

#first cloud
begin_fill()
pencolor("grey")
fillcolor("lightgrey")
forward(200)
left(45)
circle(35,150)
right(90)
circle(45,130)
right(90)
circle(60,150)
end_fill()

# second clouds
penup()
setpos(-230,-60)
pendown()
left(66)
begin_fill()
pencolor("grey")
fillcolor("lightgrey")
forward(200)
left(45)
circle(35,150)
right(90)
circle(45,130)
right(90)
circle(60,150)
end_fill()

# Third cloud
penup()
goto(180,20)
pendown()
right(25)
begin_fill()
fillcolor("lightgrey")
for i in range(4):
    circle(-30,-90)
    left(-60)
end_fill()
Is bhaag mein, hum pen ki position set karne k liye (circle, goto, left, right, forward) function ka use karte hai aur cloud draw karne ke liye (left, right, forward) function aur circle function ka use karte hai. Yahan hum begin_fill() function ka use karte hain jiska use cloud me color bharne ke liye kiya jata hai, aur function ko band karne ke liye end_fill() ka use kiya jata hai.

Draw Ram Naam ("Jay Shree Ram")
penup()
setpos(-80,150)
pendown()
right(31)
pencolor("red")
pensize(15)
forward(180)
back(100)
right(90)
forward(50)
back(50)
left(90)
forward(45)
right(90)
forward(40)
right(120)
forward(20)
right(150)
forward(50)
right(90)
forward(20)
back(50)
left(90)
back(130)
circle(-20,220)
back(70)
Yaha humne kuch functions ka use kar k Ram ji ka naam likha hai.

Complete Code:- Lord Ram Ka Naam Using Python Turtle, Jay Shree Ram

from turtle import*
title("Programming Ka Keeda")
setup(width=700, height=698)
pencolor("blue")
pensize(5)
bgcolor("black")
speed(10)

# box
penup()
setpos(-280,340)
pendown()

begin_fill()
fillcolor("darkblue")

for i in range(4):
    forward(500)
    circle(-30,90)

end_fill()  

# circle
penup()
goto(0,-110)
pendown()
pensize(5)
pencolor("red")
begin_fill()
fillcolor("darkorange")
circle(180,360)
end_fill()

#clouds

#first cloud
begin_fill()
pencolor("grey")
fillcolor("lightgrey")

forward(200)
left(45)
circle(35,150)
right(90)
circle(45,130)
right(90)
circle(60,150)
end_fill()

# second clouds
penup()
setpos(-230,-60)
pendown()
left(66)
begin_fill()
pencolor("grey")
fillcolor("lightgrey")

forward(200)
left(45)
circle(35,150)
right(90)
circle(45,130)
right(90)
circle(60,150)
end_fill()

# Third cloud
penup()
goto(180,20)
pendown()
right(25)

begin_fill()
fillcolor("lightgrey")
for i in range(4):
    circle(-30,-90)
    left(-60)

end_fill()    

# Ram Naam
penup()
setpos(-80,150)
pendown()
right(31)
pencolor("red")
pensize(15)
forward(180)
back(100)
right(90)
forward(50)
back(50)
left(90)
forward(45)
right(90)
forward(40)
right(120)
forward(20)
right(150)
forward(50)
right(90)
forward(20)
back(50)
left(90)
back(130)
circle(-20,220)
back(70)

hideturtle()
done()

Output:-

Lord Ram Ka Naam Using Python Turtle, Jay Shree Ram

Aasa hai ki apko is article ko pad kar aur Python Turtle Graphics ke throw di gai meri jankari apko acchi lagi hogi aur apko Jai Shree Ram ka code use kar k maja aya hoga.
Humari "Programming Ka Keeda" website dekhne k liye dhanyawad😊.

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

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