AnyCompiler

Aapka Pehla Python Program

Aap jo bhi Python program likhoge usme print() ka use baar baar hoga — yahi hai jisse aapka code aapse baat karta hai. Chaliye dekhte hain ki yeh exactly kya karta hai, phir ek real program run karte hain.

print() jo bhi aap parentheses ke andar likhoge use output ke roop mein dikhata hai. Text (jise programming mein "string" kehte hain) quotes ke andar hona chahiye — single (') ya double (") dono chalte hain, bas ek string ke andar consistent rehna hoga.

Comments

# symbol ke baad line mein jo bhi likha ho woh comment hota hai — Python use completely ignore kar deta hai. Comments sirf insaano ke padhne ke liye hote hain (including future mein aap khud), yeh samjhane ke liye ki kuch is tarah kyun likha gaya hai.

Khud run karke dekho

Yeh raha ek chhota program jisme ek comment aur do print() calls hain. Neeche dikha output actually execute karke nikala gaya hai — text change karke khud bhi example ke neeche button se run karke dekho.

# This is a comment - Python ignores it
print("Hello, World!")
print("Welcome to Python.")
Output
Hello, World!
Welcome to Python.

Notice karo, har print() call output mein apne aap ek nayi line se start hota hai — yeh print() ka default behavior hai. Aage aap dekhoge ki isko kaise change karte hain.

Aage: variables — values ko actually store aur reuse kaise karein, sirf fixed text print karne ke bajaye.

Practice Exercise

Apne code ke upar ek comment add karo, phir "Learning Python one step at a time." print karo.