003. Python ka syntax rule

Prathmesh Mayekar
0

Namaste dosto! Is chapter mein hum seekhenge Python ke basic syntax ya code likhne ke tareeke ko.


Python ek high-level, easy-to-read aur versatile programming language hai. Isme code likhne ke liye hum kuch important rules follow karte hain:


1. Statements: Python mein har ek code line ek statement hoti hai, jise aap ek saath likh sakte hain.


2. Indentation: Code blocks ko represent karne ke liye indentation ka use hota hai, jisme 4 spaces ka istemal hota hai. Yeh code readability aur structure ke liye important hai.


3. Comments: Code mein explanations dena ya code ko samajhne ke liye comments ka use hota hai. Comments "#" se start hote hain.


Ab hum kuch simple examples dekhenge:


Example 1: Print Statement

#Hinglish mein print statement 
print("Namaste duniya!")

Output:
Namaste duniya!


Example 2: Variables

# Hinglish mein variables 
 ladka = "Rahul" 
 ladki = "Simran" 
 umra = 25 
 print(ladka) 
 print(ladki) 
 print("Umra:", umra)

Output:

Rahul
Simran
Umra: 25


Is tarah se humne Python ke "Syntax" chapter mein basic syntax ke baare mein seekha. Aap apne Python coding journey ko shuru karne ke liye in concepts ka istemal kar sakte hain. Aage aur bhi concepts sikhne ke liye maze karte rahiye! Happy coding! 🐍😄

Post a Comment

0Comments

Post a Comment (0)

#buttons=(Accept !) #days=(20)

Our website uses cookies to enhance your experience. Check Now
Accept !