Draw Ram Naam Design in Python Programming

Yaha hum apko batayenge ki Python Turtle Programming ka use kar ke ap Ram naam kaise likh sakte hai, aur apko yaha Ram naam likha hua python code milta hai, python turtle library ka use kar k hum screen par Ram likhne ka command de sakte hai, ye code ko chalane k liye apko python turtle module install karna padega, tab hi ja k ye code run ho payega, turtle install karne ke liye apko apne VScode software ya kisi dusre software k terminal me “pip install turtle” likh k enter karna hoga, jisse apke computer me turtle module install hojayega aur ap ye code asani se run kar payenge, ap bas ab VScode software ya kisi dusre software par copy paste kar k ye code run kar sakte hai aur ap sabhi ko Jai Shree Ram.

Draw Ram Naam design in Python Programming

Draw Ram Naam Design in Python Programming

Hum is Python Program ko step by step samjhenge:

from turtle import *
Yah ek Python statement hai, jo turtle module ke sabhi naamon (functions, classes, aur variables) ko current namespace me import karta hai.

Turtle module ek built-in python module hai, jo graphics aur animations banane ke liye ek simple graphics library pradaan karta hai, yeh apko screen par ek turtle wale object ko control karne me madat karta hai, jo idhar-udhar move kar sakta hai aur alag-alag shape ki drawing banane me bhi madat karta hai.

Star symbol(*) ka use kar ke ap Python turtle module se sabhi naam import karke ap direct title(), speed(), gotot(), pensize(), bgcolor(), penup(), pendown() etc jaise functions aur methods ka use kar sakte hai.

def function:-
Python me, ‘function’ nirdeshon ke ek set ko ek sath grouped karne ka ek tarika hai, taki ap code ko doharaye bina usko kai bar use kar sake.

Kisi function ko define karne ke liye, ap function naam aur parentheses ki ek jodi ke pehle def keyword ka use karte hai, parentheses ke andar ap koi bhi input ya information specified kar sakte hai, fir ap indented block ke andar function ke liye instructions ya code likhte hai.
Jab ap function ka use karna chahte hai, to ap ise iske naam se call karte hai aur koi bhi required inputs provide karte hai, function iske andar code executes karta hai aur vaikalpik roop se result ko vapas vahi lauta sakta hai, jaha se ise call kiya gaya tha.

Kuch important functions jo program banane me use huye he:
  • title() funtion ka use title dene k liye kiya jata hai.
  • speed() function ka use pen(turtle) ki speed control karne ke liye kiya jata he.
  • fillcolor() function ka use kisi bhi drawing ke andar color karne k liye kiya jata hai.
  • pensize() function ka use pen ke border ko increase aur decrease karne k liye kiya jata hai.
  • goto() function ka use pen(turtle) ko x aur y axis me le jane ke liye kiya jata hai.
  • bgcolor() function ka use background ka color dene ke liye kiya jata hai.
  • color() function ka use pen ka color decide karne ke liye kiya jata he.
  • penup() function ka use tab kiya jata hai jab hum screen par kuch bhi nahi draw kar rahe ho.
  • pendown() function ka use tab kiya jata he jab hum screen par kuch draw kar rahe ho.
  • done() function ka use window screen ko freez karne aur program ko end karne ke liye kiya jata hai.

Full Code:-Draw Ram Naam design using Python Turtle

from turtle import*
title('www.programmingkakeeda.com')
speed(1)
fillcolor('#ff4500')
begin_fill()
pensize(5)
goto(0,310)
goto(150,220)
goto(0,150)
end_fill()

def ram(mi, su):
    speed(5)
    color(mi)
    pensize(su)
    penup()
    goto(-300,0)
    pendown()
    goto(300,0)
    goto(285,25)
    goto(300,0)
    goto(285,-25)
    goto(300,0)
    x,y,c=-150,0,10
    goto(x,y)
    y-=100
    goto(x,y)

    for i in range(10):
        goto(x,y)
        c-=2
        y-=c
        x-=i+3

    for i in range(13):
        goto(x,y)    
        c-=4-i
        y+=c
        x+=i+3

    penup()    
    goto(-50,0)
    pendown()
    goto(-50,-200)
    penup()
    goto(50,0)
    pendown()
    goto(50,-140)
    goto(35,-125)
    goto(150,-125)
    goto(150,0)
    goto(150,-200)

ram("yellow",60)    
ram("red",35)
bgcolor("#ffd700")
done()
Output:-
Draw Ram Naam design in Python Programming
Video link:- Click me
Apka humari website Programming ka keeda me aane k liye aur humare article "Draw Ram Naam Design in Python Programming" ko padhne k liye bahut-bahut dhanyaawad!

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

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