Code / Python for Beginners / Unit 1: Hello, Python

Your first program आपका पहला प्रोग्राम

Lesson 1 of 14 · about 10 minutes · print(), text in quotes and comments.

⚡ 0 XP

Step 1 of 2

Make Python talk

input()🐍main.pyprintname = input() → print(f"Namaste {name}")

A program is a list of instructions. Python reads them from top to bottom, one line at a time.

print(...) shows something on the screen. Text must go inside quotes: print("Namaste"). Numbers do not need quotes: print(15).

  • Each print() starts a new line
  • "double" or 'single' quotes both work, just don’t mix them on one piece of text
  • Python is picky about spelling: Print with a capital P is an error

Press Run on the example below and watch the output appear.

Example
print("Namaste, India! 🇮🇳")
print("Python is fun")
print(2026)

Three print() calls, three lines of output.

🎯 Challenge: The chai stall menu +10 XP

Raju’s chai stall needs a menu board. Print exactly these three lines, in this order:

  • Welcome to Raju Chai Stall
  • Masala chai: ₹15
  • Samosa: ₹12

Try twice to unlock the solution (0/2)

main.pyCtrl ⏎
Output

What your program prints appears here.

Checklist

Press Run to check your code.

  • Shows the welcome line
  • Shows Masala chai: ₹15
  • Shows Samosa: ₹12
  • Three lines, in order
Lesson notes (text version)

1. Make Python talk

A program is a list of instructions. Python reads them from top to bottom, one line at a time.

print(...) shows something on the screen. Text must go inside quotes: print("Namaste"). Numbers do not need quotes: print(15).

  • Each print() starts a new line
  • "double" or 'single' quotes both work, just don’t mix them on one piece of text
  • Python is picky about spelling: Print with a capital P is an error

Press Run on the example below and watch the output appear.

                print("Namaste, India! 🇮🇳")
print("Python is fun")
print(2026)
              

Challenge: The chai stall menu

Raju’s chai stall needs a menu board. Print exactly these three lines, in this order:

  • Welcome to Raju Chai Stall
  • Masala chai: ₹15
  • Samosa: ₹12

2. Comments and commas

A line that starts with # is a comment. Python skips it completely. Comments are notes for humans: what the code does, or why.

Adding # in front of a line is also a quick way to switch it off without deleting it.

print() can show several things at once. Separate them with commas and Python puts a space between them:

  • print("Overs:", 20) shows Overs: 20
  • print("Runs", 156, "Wickets", 4) shows Runs 156 Wickets 4
                # Scoreboard for the gully match
print("Runs:", 156)
# print("this line is switched off")
print("Wickets:", 4)
              

Challenge: Fix the scoreboard

The scoreboard program still prints a test line. Switch off the DEBUG line by putting # at its start (don’t delete it). Then add a line that prints Overs: 20 using a comma: print("Overs:", 20).

Search by task, format or tool name.