Introduction to Python
Python is a high-level, interpreted, general-purpose programming language created by Guido van Rossum and first released in 1991. It emphasizes code readability and simplicity, making it one of the most beginner-friendly and widely-used languages in the world.
What is Python?
Python is an interpreted language, meaning your code is executed line by line without a separate compilation step. It supports multiple programming paradigms including procedural, object-oriented, and functional programming.
# Your first Python program
print("Hello, World!")Running this single line will output:
Hello, World!History of Python
| Year | Milestone |
|---|---|
| 1989 | Guido van Rossum begins working on Python |
| 1991 | Python 0.9.0 released |
| 2000 | Python 2.0 released (list comprehensions, garbage collection) |
| 2008 | Python 3.0 released (major backwards-incompatible release) |
| 2020 | Python 2 reaches end of life |
| 2024 | Python 3.12+ is the current standard |
Note: Always use Python 3.x for new projects. Python 2 is no longer maintained.
Key Features of Python
1. Simple and Readable Syntax
Python uses indentation (whitespace) to define code blocks instead of curly braces, making it very readable:
# Python - clean and readable
if True:
print("Python is simple!")2. Interpreted Language
No compilation step is needed. You write code and run it immediately, which makes development faster.
3. Dynamically Typed
You don't need to declare variable types — Python infers them at runtime:
x = 10 # int
x = "hello" # now it's a string - no error!4. Extensive Standard Library
Python comes with a huge standard library often referred to as "batteries included":
import math
import datetime
import json
import os
print(math.sqrt(144)) # 12.0
print(datetime.date.today()) # 2026-02-155. Cross-Platform
Python runs on Windows, macOS, Linux, and many other platforms without modification.
6. Large Ecosystem
Over 400,000+ packages are available on PyPI (Python Package Index) for virtually any task.
What Can You Build With Python?
Python is incredibly versatile. Here are some major areas:
| Domain | Examples | Popular Libraries |
|---|---|---|
| Web Development | Websites, REST APIs | Django, Flask, FastAPI |
| Data Science | Data analysis, visualization | Pandas, NumPy, Matplotlib |
| Machine Learning | AI models, deep learning | TensorFlow, PyTorch, scikit-learn |
| Automation | Script tasks, web scraping | Selenium, BeautifulSoup, requests |
| Desktop Apps | GUI applications | Tkinter, PyQt, Kivy |
| DevOps | Infrastructure, CI/CD | Ansible, Fabric |
| Game Development | 2D games | Pygame |
Python vs Other Languages
# Python
numbers = [1, 2, 3, 4, 5]
squared = [n ** 2 for n in numbers]
print(squared) # [1, 4, 9, 16, 25]// Java - same task requires much more code
import java.util.*;
import java.util.stream.*;
public class Main {
public static void main(String[] args) {
List<Integer> numbers = Arrays.asList(1, 2, 3, 4, 5);
List<Integer> squared = numbers.stream()
.map(n -> n * n)
.collect(Collectors.toList());
System.out.println(squared);
}
}Python achieves the same result with significantly less code, making development faster and more enjoyable.
Who Uses Python?
Python is used by major companies and organizations worldwide:
- Google — Core infrastructure, AI/ML research
- Netflix — Recommendation algorithms, data pipelines
- Instagram — Backend (Django)
- NASA — Scientific computing
- Spotify — Data analysis, backend services
- Dropbox — Desktop client, server-side code
Python 2 vs Python 3
| Feature | Python 2 | Python 3 |
|---|---|---|
print "hello" | print("hello") | |
| Division | 5/2 = 2 | 5/2 = 2.5 |
| Unicode | ASCII by default | Unicode by default |
| Status | End of life (2020) | Actively developed |
Important: This entire tutorial series uses Python 3. Make sure you have Python 3.8 or higher installed.
Summary
- Python is a high-level, interpreted, dynamically-typed programming language
- Created by Guido van Rossum in 1991
- Known for its clean, readable syntax
- Used in web development, data science, AI, automation, and more
- Has a massive ecosystem of libraries and frameworks
- Always use Python 3 for new projects
- Perfect language for beginners and experienced developers alike
In the next topic, we'll set up your Python development environment so you can start writing and running Python code.