Introduction to Python & Setup
Why Python?
Python is the most versatile language in the industry: it powers Instagram’s backend, Netflix’s recommendation pipelines, NASA’s data analysis, and almost every AI lab on the planet. Its superpower is readability — Python code looks close to pseudocode, which makes it fast to write, easy to review, and beginner-friendly without being a toy.
- Web — Django, FastAPI, Flask
- Data & AI — pandas, PyTorch, scikit-learn
- Automation — scripts, scraping, DevOps tooling
Install Python
Install Python 3.12+ from python.org or your package manager, then verify:
python3 --version
# Python 3.12.xTwo Ways to Run Python
1. The REPL — an interactive prompt, perfect for experiments:
python3
>>> 2 + 2
4
>>> "coding" + " india"
'coding india'
>>> exit()2. Script files — real programs live in .py files:
# hello.py
print("Hello from Coding India")python3 hello.pyHow Python Reads Your Code
Python is interpreted (no compile step — edit and run) and dynamically typed (variables don’t declare types; values carry them). Most importantly, Python uses indentation instead of braces to define blocks:
if 5 > 3:
print("five wins") # 4 spaces of indentation = inside the if
print("always runs") # back at the left margin = outsideConsistent 4-space indentation isn’t a style preference in Python — it’s syntax. Configure your editor now and never think about it again.
Your Editor
VS Code with the official Python extension is the standard choice: autocomplete, linting, debugging, and notebook support out of the box. Enable “Format on Save” with black or ruff and your code stays clean automatically.