Lesson 01 � Foundation
PYTHON SE
HELLO BOLO.
Coding ki shuruaat syntax ratne se nahi hoti. Pehle samjho: aap computer ko tiny, exact instructions dene wale ho�aur Python un instructions ko padhne ka easy-to-read tareeqa hai.
WHY: Python kyun?
Jab aapko repeatable kaam karwana ho�marks ka average nikalna, files rename karna, web se data lena, ya AI model ko call karna�tab instructions ko code mein likhte hain. Python ka syntax relatively clean hai, isliye beginner apni energy punctuation ke bajaye problem samajhne mein laga sakta hai.
Python ek general-purpose programming language hai. Isse automation, web backends, data analysis, machine learning aur scripting ki ja sakti hai.
Jab task ko steps mein tod sakte ho: input lo, data process karo, result dikhao.
Data teams, startups, research labs aur everyday office automation�sab jagah.
HOW: pehla instruction
print() Python ko screen par kuch dikhane ke liye bolta hai. Quotes ke beech ka text exactly output ban jaata hai.
print("Namaste, Python!")
print("Main code likhna seekh raha/rahi hoon.")print ek instruction hai; parentheses ke andar us instruction ka input aata hai. Quotes batate hain ki yeh text hai, variable name nahi.Try it: code ko badal kar run karo
Editor mein apna naam add karo. Yeh real Python browser ke isolated Web Worker mein run hota hai�DSWallah server par aapka code execute nahi hota.
Syntax ka pehla rule: indentation
Python spaces ko seriously leta hai. Agar aap kisi block ke andar code likh rahe ho (jaise if ya for), uski lines indent honi chahiye. Isse code ki structure aankhon se easily dikh jaati hai.
is_logged_in = True
if is_logged_in:
print("Dashboard khol do")Abhi if ki detail yaad na karein. Bas observe karo: colon ke baad aane wali line four spaces se andar hai. Yeh Python ko batata hai ki line condition ke block mein hai.
Quick check
Screen par Hello dikhane ke liye ek valid Python line likho.
Function ka naam print hai. Text ko quotes mein rakho aur parentheses use karo.
Common beginner mistakes
- Quotes bhoolna:
print(Hello)Python ke liye variableHellohai, text nahi. - Random spaces: Indentation consistency important hai; tabs aur spaces mix mat karo.
- Error se darna: Error ek clue hai. Last line pehle padho; woh usually exact problem batati hai.
Ab variables par chalo�taaki output ke andar fixed text ke bajaye change hone wali values rakh sako.