Python · Chapter 2.1 · Basic level
Talk to the Computer (print & Variables)
कंप्यूटर से बात करो (print और जादुई डिब्बे)
Welcome to Python — the world's friendliest and most powerful language behind YouTube, Instagram, and ChatGPT! Two super-easy concepts today:
1. print(...): Commands the computer to display anything on screen.
2. Variables (Magic Labeled Boxes): Just like kitchen jars have labels (Sugar, Salt), writing naam = "Chintu" creates a glowing box in computer memory named naam with "Chintu" stored inside! Remember: text always wears quotes " ", numbers stand without quotes (12).
Python में स्वागत है — YouTube, Instagram और ChatGPT के पीछे यही आसान और शक्तिशाली भाषा काम करती है! आज बस 2 आसान बातें समझो:
1. print(...): कंप्यूटर की स्क्रीन पर कुछ भी छपवाने का हुक्म (हमेशा छोटे p से!)।
2. Variables (जादुई नाम वाले डिब्बे): जैसे रसोई में डिब्बे पर 'चीनी' या 'नमक' लिखा होता है, वैसे ही naam = "Chintu" लिखने से मेमोरी में naam नाम का डिब्बा बनता है जिसके अंदर "Chintu" रखा जाता है! याद रहे: शब्दों पर कोट्स " " लगते हैं, नंबर बिना कोट्स के (12) लिखे जाते हैं।
Words and symbols in this chapter
naam = "Chintu"- Creates a variable box named
naamand stores text"Chintu"inside it. naamनाम का वेरिएबल डिब्बा बनाता है और उसमें"Chintu"रखता है।=- Assignment sign — puts the right-side value into the left-side variable box.
- असाइनमेंट चिह्न — दाईं तरफ़ की चीज़ को बाईं तरफ़ वाले डिब्बे में डालता है।
" " (Quotes)- Tells Python this is text (String), not a command or variable name.
- कोट्स बताते हैं कि यह टेक्स्ट (String) है, कोई कमांड नहीं।
umar = 12- Stores whole number
12(no quotes needed for numbers!). - नंबर
12कोumarडिब्बे में रखता है (नंबर पर कोट्स नहीं लगते)। print(...)- Displays values on the terminal screen (always lowercase
print!). - स्क्रीन पर नतीजा दिखाता है (ध्यान रहे
printकाpहमेशा छोटा होता है!)। , (Comma)- Inside
print(a, b), comma prints multiple items with a space between them. printके अंदर कॉमा,लगाने से दो चीज़ें स्पेस के साथ एक साथ छपती हैं।
Ready example
naam = "Chintu"
umar = 12
game = "Minecraft"
print("Mera naam hai:", naam)
print("Meri umar hai:", umar)
print("Favourite game:", game)
What you will see: Right side shows BOTH the Terminal Output AND glowing 3D Visual Memory Boxes (naam, umar, game)!
दाईं तरफ़ टर्मिनल आउटपुट के साथ-साथ मेमोरी के असली चमकते हुए जादुई डिब्बे (naam, umar, game) दिखेंगे!
Line by line
naam = "Chintu"- Makes memory box
naamcontaining string'Chintu'. - मेमोरी में
naamडिब्बा बना जिसमें'Chintu'रखा गया। umar = 12- Makes memory box
umarcontaining integer12. umarडिब्बे में संख्या12रखी गई।game = "Minecraft"- Makes memory box
gamecontaining'Minecraft'. gameडिब्बे में'Minecraft'रखा गया।print("Favourite game:", game)- Prints label text followed by whatever is inside the
gamebox! - स्क्रीन पर टेक्स्ट और
gameडिब्बे के अंदर की वैल्यू छापता है!
Common mistake
✗ Wrong
Print(Hello)✓ Right
print("Hello")Two classic bugs: capital P in Print (Python is lowercase print) and missing quotes " " around text!
दो सबसे आम गलतियाँ: print का p हमेशा छोटा (small) होता है, और टेक्स्ट पर कोट्स " " लगाना ज़रूरी है!
Your task
Create a variable game = "Minecraft" (or your favourite game, keep variable name game) and print it with print(game)!
game = "Minecraft" नाम का वेरिएबल बनाओ और print(game) लिखकर उसे स्क्रीन पर छपवाओ!
- Line 1: Write
game = "Minecraft".
लाइन 1:game = "Minecraft"लिखो। - Line 2: Write
print(game)(no quotes aroundgamewhen printing the variable!).
लाइन 2:print(game)लिखो (वेरिएबल प्रिंट करते समयgameपर कोट्स मत लगाना)। - Click ▶ Run & Preview and watch the 3D Memory Box glow!
▶ Run & Preview दबाओ और जादुई मेमोरी डिब्बा चमकते देखो!
Starter code for the task
player = "Chintu"
print("Player:", player)
# TODO 1: neeche ek variable banao: game = "Minecraft" (ya apna favourite game)
# TODO 2: print(game) se use screen par dikhaoDo this task in the classroom: your code is checked automatically and you get hints if something is missing.
Recap
print(...)shows output on the screen.- A variable is a labelled box:
game = "Minecraft"stores a value. - Text needs quotes
" ", numbers do not;print(game)uses the variable without quotes.
print(...)स्क्रीन पर आउटपुट दिखाता है।- Variable नाम लिखा डिब्बा है:
game = "Minecraft"एक वैल्यू रख लेता है। - टेक्स्ट को कोट्स
" "चाहिए, नंबर को नहीं;print(game)में variable बिना कोट्स के लिखते हैं।
Quick quiz
Which Python code correctly prints the value stored inside variable naam?
naam वेरिएबल के अंदर रखी वैल्यू को प्रिंट करने का सही कोड कौन-सा है?
Show the answer
Answer: C (print(naam))
Lowercase print(naam) without quotes prints the value inside the naam box!
बिना कोट्स के छोटा print(naam) लिखने पर डिब्बे के अंदर की वैल्यू छपती है!
Practice problems for this chapter
- Cricket Player Card (variables + print)
क्रिकेट प्लेयर कार्ड (variables + print)
Solve them in the Practice Zone, where each answer is checked automatically and two hints are available.