What is programming?
A program is a list of instructions that tells a computer exactly what to do. Computers are fast but not clever. They follow instructions literally. Programming is the skill of breaking a problem into small, clear steps and writing them in a language the computer understands.
Think of a recipe: "Boil water. Add tea leaves. Boil for 2 minutes. Add milk and sugar." A program is a recipe for a computer.
Why Python?
- Easy to read: Python code looks close to plain English.
- Versatile: used for automation, data analysis, websites, AI and machine learning, games and teaching.
- Huge community: free libraries and answers for almost any problem.
- In demand: Python skills appear in many data and software job descriptions.
Option 1: Use Python in your browser (no installation)
If you are on a shared or low-spec computer, use a free online editor. Search for "online Python editor" or use services such as Google Colab (needs a Google account), Programiz Online Python Compiler or Replit. Type code on one side and click Run.
Option 2: Install Python on Windows
- Go to the official website
python.org → Downloads → download the latest Python 3 release for Windows. - Run the installer and tick "Add python.exe to PATH" before clicking Install Now. This step is important.
- Open the Start menu, search for IDLE (Python's simple editor) and open it.
To check the installation, open Command Prompt and type:
python --version
You should see something like Python 3.13.x.
For bigger projects many programmers use the free editor Visual Studio Code with the Python extension.
Your first program
In IDLE choose File → New File, type the line below, save it as hello.py and press F5 to run:
print("Namaste! I am learning Python.")
Output:
Namaste! I am learning Python.
print() is a function that displays whatever you put inside the brackets. Text must be inside quotation marks.
Comments
Lines that start with # are comments. Python ignores them; they are notes for humans.
# This program greets the user
print("Welcome to the Python course")
Errors are normal
If you misspell something, Python shows an error message, for example SyntaxError or NameError. Read the last line of the message. It tells you what went wrong and on which line. Every programmer sees errors every day.
Practical exercise
- Set up Python (installed or online).
- Write a program that prints your name, your city and your favourite subject on three separate lines.
- Add a comment at the top describing the program.
- Deliberately remove a quotation mark, run it, and read the error message. Then fix it.