🧠 AI Computer Institute
Content is AI-generated for educational purposes. Verify critical information independently. A bharath.ai initiative.

Introduction to Python: Hello, World!

📚 Programming⏱️ 18 min read🎓 Grade 6

📋 Before You Start

To get the most from this chapter, you should be comfortable with: foundational concepts in computer science, basic problem-solving skills

Introduction to Python: Hello, World!

In Grade 5, you learned Scratch — visual programming with blocks. Now it's time for real programming. You're going to learn Python, one of the most popular programming languages in the world.

Why Python? Because it's:

- Easy to learn: Python reads almost like English
- Powerful: Used by Google, Netflix, Instagram, NASA
- Versatile: You can build websites, apps, AI systems, data analysis tools
- Popular: Most beginner programmers start with Python

Getting Started with Python

Option 1: Online (No Installation)
Go to repl.it or trinket.io. Both are free, browser-based Python environments. You can write code and run it instantly.

Option 2: Install Python
Download Python from python.org. It's free. Installation takes 5 minutes.

For this chapter, I'll assume you're using an online tool like repl.it.

Your First Program: Hello, World!

Every programmer's first program prints "Hello, World!" to the screen. It's tradition.

Open repl.it or Python IDLE. Type this:

print("Hello, World!")

Press Enter. The screen shows:

Hello, World!

Congratulations! You just wrote and executed a Python program!

Let's break down what happened:

print() — A function that displays text on the screen
"Hello, World!" — The text to display, enclosed in quotes
() — Parentheses are required after a function name

Understanding Functions

A function is a block of code that does a specific task.

print() is a built-in function that outputs text.

You can call functions by typing their name and ():

print("My name is Arjun")
print("I am 12 years old")
print("I love cricket")

Output:

My name is Arjun
I am 12 years old
I love cricket

Notice: Python executes code line by line, from top to bottom.

Variables: Storing Information

A variable is a container that holds a value. Like a box where you store data.

name = "Priya"
age = 12
print(name)
print(age)

Output:

Priya
12

Breaking it down:

name = "Priya" — Create a variable called "name" and put the text "Priya" in it
age = 12 — Create a variable called "age" and put the number 12 in it
print(name) — Print whatever is in the variable "name" (which is "Priya")

Variable names can be anything (but should be meaningful):

favorite_color = "blue"
school_name = "Delhi Public School"
test_score = 95
height_cm = 150

Data Types

Different types of data:

String (text): "Hello", "Raj", "ABC123" (enclosed in quotes)

message = "Welcome to Python"
print(message)

Integer (whole numbers): 5, -3, 1000 (no quotes)

number = 42
print(number)

Float (decimal numbers): 3.14, 2.5, -0.5

pi = 3.14159
price = 49.99
print(pi)

Boolean (True/False):

is_raining = False
is_student = True
print(is_student)

Input: Asking the User Questions

So far, we've only output information. Let's ask the user for input.

name = input("What is your name? ")
print("Hello, " + name)

When you run this, Python pauses and waits for you to type something. You type "Arjun". Then it prints:

Hello, Arjun

Notice the + operator. It combines two strings together. This is called "string concatenation."

first = "Raj"
last = "Kumar"
full_name = first + " " + last
print(full_name)

Output:

Raj Kumar

Simple Math

Python can do math:

print(2 + 3)        # Output: 5
print(10 - 4)       # Output: 6
print(3 * 4)        # Output: 12
print(10 / 2)       # Output: 5.0
print(10 // 3)      # Output: 3 (integer division)
print(10 % 3)       # Output: 1 (remainder)

The % operator gives the remainder after division.

You can store math results in variables:

a = 10
b = 5
sum = a + b
print(sum)          # Output: 15

Project: Cricket Score Calculator

Let's build something useful. A simple cricket score calculator:

player_name = input("Enter player name: ")
runs = int(input("How many runs? "))
balls = int(input("How many balls faced? "))

strike_rate = (runs / balls) * 100
print(player_name + " scored " + str(runs) + " runs in " + str(balls) + " balls")
print("Strike rate: " + str(strike_rate))

Let's walk through this:

input() — Gets text from the user
int() — Converts text to a whole number. "10" becomes 10
str() — Converts a number to text. 95 becomes "95"
The math calculates strike rate: (runs/balls)*100

Sample run:

Enter player name: Virat Kohli
How many runs? 183
How many balls faced? 182
Virat Kohli scored 183 runs in 182 balls
Strike rate: 100.549450549

Comments: Explaining Your Code

In Python, # starts a comment. Comments are ignored by Python and are just for humans reading the code.

name = input("Enter your name: ")  # Ask the user for their name
age = int(input("Enter your age: "))  # Ask for age and convert to number
print("Hello, " + name)  # Greet the user

Good comments explain WHY you did something, not WHAT you did (the code already shows that).

Common Mistakes

Forgetting quotes around text:

print(Hello)  # ERROR! Should be print("Hello")

Using = instead of ==: = assigns a value. == checks if equal.

x = 5  # Assign 5 to x
if x == 5:  # Check if x equals 5

Indentation errors: Python is picky about indentation. But we'll learn about that when we cover if statements and loops.

The Python Shell

When you open Python IDLE or repl.it, you see a prompt like:

>>>

You can type Python commands directly here and see results immediately. This is called the "interactive mode" or "shell."

>>> print("Hello")
Hello
>>> 2 + 3
5
>>> name = "Raj"
>>> print(name)
Raj
>>>

This is great for experimenting and learning. But for larger programs, you write a ".py" file.

Key Vocabulary
  • Python — A popular, beginner-friendly programming language
  • Function — A block of code that performs a task
  • Variable — A container that holds a value
  • Data Type — The type of data: string, integer, float, boolean
  • String — Text data enclosed in quotes
  • Integer — Whole number without decimal
  • Float — Number with decimal point
  • Operator — Symbol like +, -, *, / for operations
  • Input — Getting data from the user
  • Output — Displaying data to the user
Did You Know? Python was created in 1991 by Guido van Rossum. He named it after the British comedy group "Monty Python" because he thought the name was short and funny. Python is used by companies like Google, Netflix, Spotify, and Instagram. Even NASA uses Python for data analysis!
Try This! Write a Python program that asks for three pieces of information: your name, your favorite food, and your favorite subject. Then print a sentence using all three pieces of information. Example: "My name is Arjun, I love eating dosa, and my favorite subject is Math." Extend it: ask for a number and calculate something with it (like age in 5 years, or distance in kilometers converted to miles).

📝 Key Takeaways

  • ✅ This topic is fundamental to understanding how data and computation work
  • ✅ Mastering these concepts opens doors to more advanced topics
  • ✅ Practice and experimentation are key to deep understanding

🇮🇳 India Connection

Indian technology companies and researchers are leaders in applying these concepts to solve real-world problems affecting billions of people. From ISRO's space missions to Aadhaar's biometric system, Indian innovation depends on strong fundamentals in computer science.


The Big Picture: Why Introduction to Python: Hello, World! Matters

Have you ever watched a magic show and thought, "How did they DO that?" Technology can feel like magic sometimes — video calls connecting you to someone across the world, apps that know what song you want to hear next, games where characters seem to think for themselves. But here is the secret: none of it is magic. It is all built on ideas that YOU can understand.

Introduction to Python: Hello, World! is one of those big ideas. It might sound complicated, but think of it this way: every tall building starts with a single brick. Every long journey starts with a single step. And every great computer scientist started by being curious about exactly the kind of thing we are going to explore today.

In India, technology is transforming everything — from how farmers check weather forecasts using their phones to how your school might use digital boards instead of blackboards. Understanding introduction to python: hello, world! is like having a superpower: it lets you see how the digital world actually works, instead of just using it blindly.

Variables, Loops, and Making Decisions

Programs become powerful when they can remember things, repeat actions, and make choices. These three abilities — variables, loops, and conditionals — are the building blocks of ALL software:

# VARIABLES — the computer's memory
name = "Priya"            # Stores text (string)
age = 12                  # Stores a whole number (integer)
height = 4.8              # Stores a decimal (float)
likes_cricket = True      # Stores True or False (boolean)

# CONDITIONALS — making decisions
if age >= 13:
    print(f"{name} is a teenager!")
elif age >= 6:
    print(f"{name} is in school!")
else:
    print(f"{name} is very young!")

# LOOPS — repeating actions
print("
Counting to 10:")
for number in range(1, 11):
    if number % 2 == 0:
        print(f"  {number} is EVEN")
    else:
        print(f"  {number} is odd")

# REAL-WORLD EXAMPLE: Calculate your cricket batting average
scores = [45, 72, 0, 88, 23, 105, 34]
total = sum(scores)
innings = len(scores)
average = total / innings
print(f"
Batting average: {average:.1f} runs per innings")

Notice how the code reads almost like English? That is Python's superpower — it was designed to be readable. The indentation (spacing) is not just for looks; Python REQUIRES it to know which code belongs inside an if block or a for loop. In India, Python is now taught from Class 6 in many CBSE schools as part of the NEP 2020 curriculum.

Did You Know?

🍕 Swiggy and Zomato process millions of orders per day. Every time you order food on Swiggy or Zomato, a complex system springs into action: your order is received, stored in a database, matched with a restaurant, tracked in real-time, and delivered. The engineering behind this would have seemed like science fiction 15 years ago. Two Indian apps, built by Indian engineers, feeding millions of Indians every day.

💳 India Stack — the world's most advanced digital infrastructure. Aadhaar (biometric ID for 1.4 billion people), UPI (instant digital payments), and ONDC (open network for e-commerce) are part of the India Stack. This is not Western technology adapted for India — this is Indian innovation that the world is trying to copy. The software engineers who built this started exactly where you are.

🎬 Netflix uses algorithms developed in India. Recommendation algorithms that suggest which movie you should watch next? Many Netflix engineers are based in Bangalore and Hyderabad. When you see "Recommended for You" on any streaming platform, there is a good chance an Indian engineer designed that algorithm.

📱 India is the world's largest developer of mobile apps. The most downloaded apps globally are built by Indian companies: WhatsApp (used by billions), Hike (messaging), and many others. Indian startup founders are launching companies in AI, biotech, and space technology. Your peers are already building the future.

The Dabbawala Analogy

Mumbai's dabbawalas deliver 200,000 lunch boxes every day with an error rate of 1 in 16 million — better accuracy than most computer systems! Their system is actually a brilliant algorithm: each dabba has a colour code (like an IP address), a number (like a port), and follows a specific route (like packet routing). The sorting system at Churchgate station is essentially a load balancer — distributing dabbawalas across delivery zones. When computer scientists study efficient delivery systems, they literally study the dabbawalas as a real-world example of distributed computing done right.

How It Works — The Process Explained

Let us walk through the process of introduction to python: hello, world! in a way that shows how engineers think about problems:

Step 1: Define the Problem Clearly
Engineers always start here. What exactly needs to happen? What are the inputs? What should the output be? What could go wrong? In our case, with introduction to python: hello, world!, we need to understand: what data are we working with? What transformations need to happen? What are the constraints?

Step 2: Design the Approach
Before writing any code or building anything, engineers draw diagrams. They sketch out: how will data flow? What are the main stages? Where are the bottlenecks? This is like an architect drawing blueprints before constructing a building.

Step 3: Implement the Core Logic
Now we translate the design into actual code or systems. Each component handles its specific responsibility. For introduction to python: hello, world!, this might involve: data structures (how to organize information), algorithms (step-by-step procedures), and error handling (what happens if something goes wrong).

Step 4: Test and Verify
Engineers test their work obsessively. They try normal cases, edge cases, and intentionally broken cases. They measure performance: is it fast enough? Does it use too much memory? Are there bugs? This testing phase often takes as long as the implementation phase.

Step 5: Deploy and Monitor
Once tested, the system goes live. But engineers do not stop there. They monitor it 24/7: How many requests per second? Is there any lag? Are users happy? If problems appear, engineers can quickly fix them without stopping the entire system.


Building a Web Page Step by Step

Let us build a simple web page together. Think of HTML as the skeleton (structure), CSS as the skin and clothes (appearance), and JavaScript as the muscles (behaviour).

<!DOCTYPE html>
<html>
<head>
  <title>My India Page</title>
  <style>
    body { font-family: Arial; background: #f0f8ff; }
    .card { background: white; padding: 20px; border-radius: 10px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1); margin: 20px; }
    h1 { color: #FF6600; }
    button { background: #25D366; color: white; padding: 10px 20px;
             border: none; border-radius: 5px; cursor: pointer; }
  </style>
</head>
<body>
  <div class="card">
    <h1>Welcome to My Page!</h1>
    <p id="message">Click the button to see magic</p>
    <button onclick="changePage()">Click Me!</button>
  </div>
  <script>
    function changePage() {
      document.getElementById('message').textContent =
        'Namaste! You just used JavaScript! 🎉';
    }
  </script>
</body>
</html>

This single file demonstrates all three web technologies working together. The HTML creates the structure (heading, paragraph, button), the CSS inside the <style> tag makes it look beautiful (rounded cards, colours, shadows), and the JavaScript inside the <script> tag makes the button actually DO something. When you click the button, JavaScript finds the paragraph by its ID and changes its text. This is exactly how real websites like Flipkart and Zomato work — just with thousands more lines of code!

Real Story from India

Priya Orders Food Using UPI

Priya is a college student in Mumbai. It is 9 PM, she is hungry but broke until her salary arrives in 2 days. She opens Zomato, orders from her favorite restaurant, and pays using Google Pay (which uses UPI). The restaurant receives the order instantly. A delivery driver gets assigned. The restaurant cooks the food. Fifteen minutes later, it arrives at Priya's door still hot.

Behind this simple 15-minute experience is extraordinary engineering. The order was received by Zomato's servers, stored in databases, checked for inventory, forwarded to the restaurant's system, assigned to a driver using optimization algorithms, tracked in real-time, and processed through payment systems handling billions of rupees daily.

UPI (Unified Payments Interface) was built by NPCI (National Payments Corporation of India) — an organization founded by Indian banks. It handles more transactions per second than all Western payment systems combined. The software engineers who built UPI, Zomato, and Google Pay started where you are: learning computer science fundamentals.

India's startup ecosystem (Swiggy, Zomato, Flipkart, Razorpay) has created millions of jobs and changed how millions of Indians live. The engineers behind these companies earn ₹20-100+ LPA and solve problems affecting 1.4 billion people. This is the kind of impact computer science can have.

Going Deeper: The Real-World Impact

Let us connect what you have learned about introduction to python: hello, world! to the real world. Every year, millions of students across India prepare for exams — CBSE boards, JEE, NEET, and state board exams. More and more of these students are using technology to prepare. Apps like Byju's, Unacademy, and Vedantu use the very concepts you are learning to deliver personalised learning. When the app figures out which topics you are struggling with and gives you extra practice questions, that is computer science at work!

The Indian government's DIKSHA platform uses technology to train teachers and provide digital textbooks in multiple Indian languages. When a teacher in a remote village in Jharkhand accesses a teaching video in Hindi, that video is stored on a server, delivered over the internet, decoded by a browser, and displayed on a screen — all using the principles we are discussing. Every layer of this process uses concepts from introduction to python: hello, world!.

India's Aadhaar system is perhaps the most impressive example of technology at scale anywhere in the world. It gives a unique 12-digit identity to every one of India's 1.4 billion citizens using fingerprint and iris scans. This system uses databases to store records, encryption to protect data, networking to verify identities, and algorithms to match biometrics. Understanding introduction to python: hello, world! is literally understanding a piece of how India's digital backbone works.

Here is a career perspective: India's IT industry employs over 5 million people and generates $245 billion in revenue. New fields like AI, cybersecurity, cloud computing, and data science are growing even faster. The demand for people who understand introduction to python: hello, world! is only increasing. By the time you finish school, there will be jobs that do not even exist today — but they will all need people who understand the fundamentals you are building right now.

Quick Knowledge Check ✓

Challenge yourself with these questions:

Question 1: What are the main steps involved in introduction to python: hello, world!? Can you list them in order?

Answer: Check the "How It Works" section above. If you can recite the steps from memory, excellent!

Question 2: Why is introduction to python: hello, world! important in the context of Indian technology companies like Flipkart or UPI?

Answer: These companies rely on introduction to python: hello, world! to serve millions of users simultaneously and ensure reliability.

Question 3: If you were designing a system using introduction to python: hello, world!, what challenges would you need to solve?

Answer: Performance, reliability, maintainability, security — check these against what you learned in this chapter.

Key Vocabulary

Here are important terms from this chapter that you should know:

Function: A reusable block of code that performs a specific task
Loop: Code that repeats the same steps multiple times
Condition: A test that determines which code path to follow
Array: An ordered collection of items stored under one name
String: A sequence of characters (text) in a program

🧪 Challenge: Design Your Own System

Here is a design challenge: imagine you are building a system for your school canteen. Students should be able to see the day's menu on their phones, place orders before lunch break, and pick up their food without waiting in line. Think about: What data do you need to store? (menu items, prices, student names, orders) How would the ordering work? (app sends order → canteen receives it → food is prepared → student is notified) What could go wrong? (two students order the last samosa at the same time!) This is exactly how engineers at Swiggy and Zomato think about building their systems. Try drawing a diagram on paper!

Connecting the Dots

Introduction to Python: Hello, World! does not exist in isolation — it connects to everything else in computer science. The concepts you learned here will show up again and again: in web development, in AI, in app building, in cybersecurity. Computer science is like a giant jigsaw puzzle, and each chapter you complete adds another piece. Some day, you will step back and see the complete picture — and it will be beautiful.

India is producing the next generation of global tech leaders. Students from IITs, NITs, IIIT Hyderabad, and BITS Pilani are founding companies, leading engineering teams at Google and Microsoft, and solving problems that affect billions of people. Your journey through these chapters is the same journey they started on. Keep building, keep experimenting, and most importantly, keep enjoying the process.

Crafted for Class 4–6 • Programming • Aligned with NEP 2020 & CBSE Curriculum

← Logic and Boolean ThinkingHow Computers Store Pictures, Music, and Video →
📱 Share on WhatsApp