Lesson 1 of 12

Python Introduction

Python is a programming language known for code that reads almost like plain English. It is often the first language taught in Indian colleges and coding courses, and it is also used every day by professional developers, data analysts and scientists. In this Python introduction you will learn what Python is good at, install it on your own computer and run your first program from a file.

What is Python?

Python was created by Guido van Rossum and first released in 1991. Today it is developed in the open by the Python Software Foundation and a large community. It is free to download and use, and it runs on Windows, macOS and Linux.

Three things make Python friendly for beginners:

  • Readable syntax. Blocks of code are marked by indentation instead of curly braces, so code has to be neatly laid out before it will run.
  • An interpreter. You do not compile anything yourself. Python reads your file and runs it straight away, so you see results immediately.
  • “Batteries included”. The standard library that comes with Python already handles files, dates, maths, JSON, CSV, web requests and much more.

What can you build with Python?

AreaTypical use
Automation and scriptsRenaming hundreds of files, cleaning Excel or CSV data, sending reports
Web back endsWebsites and APIs with frameworks such as Django or Flask
Data analysisReading sales data, finding trends, drawing charts
Machine learning and AITraining and using models with popular open-source libraries
Teaching and testingLearning programming ideas, writing automated tests for other software

For a web designer, Python is a useful second language after JavaScript. JavaScript runs in the browser; Python usually runs on your computer or on a server.

Installing Python

This Python introduction and the rest of the track use Python 3. In October 2026 the current release is Python 3.14, and every example here works in Python 3.12 or newer. Python 2 reached its end of life in 2020, so ignore any tutorial that writes print "hello" without brackets.

Windows

  1. Go to python.org/downloads and download the Python install manager. The same app is also available in the Microsoft Store. It is now the recommended way to install Python on Windows; the older full .exe installer is deprecated and will not be made for Python 3.16 and later.
  2. Run the downloaded file and follow the steps. If it offers to add its folder to your PATH, accept, so the commands work in any terminal.
  3. Open Terminal (or Command Prompt) and type py install 3.14 to install that version. You can also simply type py: if no Python is installed yet, it fetches the latest version for you.
  4. Check it with py --version. py list shows every version you have installed.

macOS

  1. Download the macOS installer package (.pkg) from python.org/downloads and double-click it.
  2. Follow the installer. It creates a Python 3.14 folder in Applications containing IDLE, a simple editor that comes with Python.
  3. In that folder, double-click Install Certificates.command so that Python can make secure HTTPS connections.
  4. Open Terminal and check with python3 --version. On a Mac, use python3, not python.

Linux

Most Linux distributions already include Python 3. Open a terminal and type python3 --version. If it is missing, install it with your package manager, for example sudo apt install python3 on Ubuntu or Debian and sudo dnf install python3 on Fedora. Do not remove the system Python: parts of Linux depend on it.

Watch out: On Windows, if typing python opens the Microsoft Store instead of Python, use py, or turn off the “App execution aliases” for Python in Windows Settings.

The interactive shell

Type py (Windows) or python3 (macOS and Linux) on its own and press Enter. You get the >>> prompt, also called the REPL (read, evaluate, print, loop). Type 7 * 6, press Enter, and Python answers 42 straight away. The shell is perfect for quick experiments, and recent versions add colours and easy editing of multi-line code. Type exit or press Ctrl+D (Ctrl+Z then Enter on Windows) to leave.

Your first Python file

Real programs live in files ending in .py. Use any plain-text code editor: IDLE comes with Python, and Visual Studio Code with its Python extension is a popular free choice. Create a folder such as python-practice, make a file named hello.py inside it and type:

print("Vanakkam! Welcome to Python.")
print("I am learning Python in Puducherry.")
print("Python is", 2026 - 1991, "years old.")
Output
Vanakkam! Welcome to Python.
I am learning Python in Puducherry.
Python is 35 years old.

print() is a built-in function that shows text on the screen. Text goes inside quotes; numbers and calculations do not. When you give print() several values separated by commas, it puts a space between them.

Running the file

  1. Open a terminal in the folder that holds hello.py. In VS Code use Terminal → New Terminal; elsewhere use cd to move into the folder.
  2. Windows: type py hello.py. macOS and Linux: type python3 hello.py.
  3. Press Enter. The three lines shown above appear in the terminal.

In IDLE you can instead open the file and press F5. In VS Code, the Run button at the top right does the same job.

A slightly bigger program

Programs become useful when they remember values. The next file stores a name, a city and an age in variables and builds sentences with f-strings: strings with an f before the quotes, in which {…} is replaced by a value. You will study both properly in the next lessons.

name = "Priya"
city = "Coimbatore"
age = 21

print(f"Hello, {name} from {city}!")
print(f"Next year you will be {age + 1}.")
Output
Hello, Priya from Coimbatore!
Next year you will be 22.

Tip: In this track every example shows its exact output under the code. You learn faster if you type the examples yourself instead of copying them, then change the values and run them again.

Where to go after this Python introduction

Next, learn the basic rules of the language in Python Syntax and Variables.

Further reading

Key takeaways

  • Python is a free, readable, interpreted language used for automation, web back ends, data and AI.
  • On Windows, install Python with the Python install manager from python.org or the Microsoft Store and run it with py.
  • On macOS use the python.org .pkg installer and python3; on Linux Python 3 is usually preinstalled.
  • Save code in a .py file and run it with py file.py or python3 file.py.
  • print() shows values on the screen; the >>> shell is handy for quick tests.

Quick quiz

Check what you learned – pick an answer.

1. Which command runs a file called app.py on macOS or Linux?

2. What is the recommended way to install Python on Windows today?

3. What does print("Total:", 40 + 60) show?

Practice exercise

Create a file named about_me.py that prints three lines: your name, your city and how many hours a week you plan to practise Python. Run it from the terminal.

Show a hint

Use one print() call per line. For the hours, try printing a calculation such as 1 * 7 for one hour a day.

Show the solution

# about_me.py print("Name: Karthik") print("City: Tiruchirappalli") print("Practice hours per week:", 1 * 7)

Progress is saved in this browser only.