Skip to content
VJ Classes

One place to learn science, commerce, arts, computers and life skills

Imagine your coaching centre has the marks of 300 students and needs each student’s total, percentage and grade. By hand, that is a full day of work, and a few mistakes will creep in. A computer can do it in under a second, but only if someone tells it exactly what to do. How do we give a computer precise instructions that it will follow in the same way, every single time? Programming exists to answer that question, and Python is one of the easiest languages in which to learn the answer.

What a program is

A computer is fast and obedient, but it understands nothing on its own. A program is a list of instructions written so precisely that a machine can carry them out without guessing. “Find the average” is too vague for a computer; “add the five marks in this list and divide the sum by five” is exact.

Inside, a processor understands only machine code: long patterns of 0s and 1s. Writing that by hand is slow and error-prone, so we use a programming language, a set of words and rules that people can read and that software can translate for the machine. Python is a high-level language: you write in terms of names, numbers and text, and Python looks after details such as memory.

Where Python came from

Python was created by Guido van Rossum, a Dutch programmer. He began work on it in December 1989 at CWI, a research institute for mathematics and computer science in Amsterdam, and released the first version in 1991. The name comes from the British comedy show Monty Python’s Flying Circus, not from the snake.

Python 3, a cleaned-up version that does not run all older code unchanged, arrived in 2008, and support for Python 2 ended in 2020. This course uses Python 3 throughout. Python is free and open source: anyone may download, use and share it.

Why Python is a good first language

  • Readable code. Python uses indentation (spaces at the start of a line) to group statements, so programs look tidy and are easy to follow.
  • Little ceremony. A complete program can be one line long. You do not declare types or write a main function before you start.
  • Batteries included. The standard library that comes with Python has ready-made tools for maths, dates, files, random numbers and much more.
  • A huge ecosystem. Free packages such as pandas (data), Django (websites) and scikit-learn (machine learning) are written for Python.
  • Runs everywhere. The same program runs on Windows, macOS and Linux.

When you run a program, the Python interpreter reads your code, translates it into an internal form called bytecode and executes it, all in one step, so there is no separate compile command. The trade-off is speed: Python usually runs slower than C or Java. For everyday tasks this rarely matters, and libraries such as NumPy do their heavy calculations in fast compiled code underneath.

Here is a complete Python program. Do not worry about the details yet; just notice how readable it is.

marks = [78, 85, 92, 66, 74]
print("Total:", sum(marks))
print("Average:", sum(marks) / len(marks))
Total: 395
Average: 79.0

Reading a program line by line

  • Line 1 stores five marks in a list called marks.
  • Line 2 adds them with the built-in function sum() and shows the result with print(): 78 + 85 + 92 + 66 + 74 = 395.
  • Line 3 divides the total by len(marks), the number of marks, so 395 ÷ 5 = 79.0.

Written in C, the same job takes about a dozen lines, with a loop, type declarations and a main function.

Where Python is used

AreaWhat Python does there
Data analysisCleaning, summarising and charting data with pandas
Machine learning and AITraining models with libraries such as scikit-learn and PyTorch
Web developmentRunning the server side of websites with Django or Flask
AutomationRenaming files, filling spreadsheets, sending reports
Science and teachingCalculations, simulations and first programming courses

Python in Indian classrooms and jobs

CBSE’s Computer Science and Informatics Practices courses for Classes 11 and 12 use Python, so many students meet it in school. In the job market, Python is a common requirement for data analyst, data science, automation and backend developer roles, often together with SQL.

Key points

  • A program is a precise list of instructions; a programming language lets people write them in a readable form.
  • Python was created by Guido van Rossum and first released in 1991; this course uses Python 3.
  • Python is readable, comes with a large standard library and runs on Windows, macOS and Linux.
  • The interpreter runs your code directly; Python is slower than C or Java but much quicker to write.
  • Python is used in data analysis, machine learning, web development, automation and teaching.