For AI and data science, learn Python's core first: variables, control flow, functions, lists, dictionaries, files and classes. Then learn NumPy and Pandas for data, Matplotlib for charts, scikit-learn for machine learning and PyTorch for deep learning. Practise on small real datasets from the start.
Why Python for AI?
Python is readable, has a huge ecosystem of scientific libraries, and is the language most AI research and tooling is built around. Code you write for a small experiment can grow into a real pipeline.
Which Python topics should you learn first?
- Variables, data types, operators, conditions and loops
- Functions, scope and recursion
- Lists, tuples, dictionaries, sets and strings
- Reading and writing files; handling errors
- Classes and objects (OOP)
- Modules, packages, pip and virtual environments
- Iterators, generators, decorators and lambdas
- Working with APIs and JSON; regular expressions
Which libraries matter, and when?
| Library | Used for | Learn it when |
|---|---|---|
| NumPy | Fast arrays and maths | Right after core Python |
| Pandas | Tables of data: cleaning, grouping, joining | With your first dataset |
| Matplotlib / Seaborn | Charts | For exploring data |
| scikit-learn | Classical machine learning | When you start ML |
| PyTorch | Deep learning and LLMs | When you start neural networks |
| Hugging Face Transformers | Pretrained language models | When you start NLP and LLMs |
A simple practice plan
- Write a little Python every day, even 30 minutes.
- Build three small programs: a calculator, a to-do app and a file organiser.
- Analyse one public dataset end to end with Pandas and charts.
- Push everything to GitHub with a short README.
Program Zero teaches Python in Phase 1 (alongside JavaScript), then uses it through data science, deep learning and LLMs. New to all of this? Start with what is data science.