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?

  1. Variables, data types, operators, conditions and loops
  2. Functions, scope and recursion
  3. Lists, tuples, dictionaries, sets and strings
  4. Reading and writing files; handling errors
  5. Classes and objects (OOP)
  6. Modules, packages, pip and virtual environments
  7. Iterators, generators, decorators and lambdas
  8. Working with APIs and JSON; regular expressions

Which libraries matter, and when?

LibraryUsed forLearn it when
NumPyFast arrays and mathsRight after core Python
PandasTables of data: cleaning, grouping, joiningWith your first dataset
Matplotlib / SeabornChartsFor exploring data
scikit-learnClassical machine learningWhen you start ML
PyTorchDeep learning and LLMsWhen you start neural networks
Hugging Face TransformersPretrained language modelsWhen 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.