Computer science foundations
CS50x for a real understanding of computing, or CS50P for just enough Python to move fast.
Take CS50x if you want to really understand computing; take CS50P if you only want enough Python to get to AI quickly. Both are free on edX (a verified certificate is optional and paid), and both have the same lectures and problem sets free at cs50.harvard.edu.
Option A: CS50x, Introduction to Computer Science (about 10–12 weeks)
| Week | Topic | Why it matters for AI |
|---|---|---|
| 0 | Scratch | Thinking in algorithms, loops and conditions |
| 1 | C | How code actually runs; types and compilation |
| 2 | Arrays | Data stored in sequence: the ancestor of tensors |
| 3 | Algorithms | Searching, sorting, Big-O: how cost grows with data size |
| 4 | Memory | Pointers and memory: why big models need big hardware |
| 5 | Data structures | Hash tables, trees, graphs: the shapes AI search works over |
| 6 | Python | The language of AI |
| 7 | SQL | Querying data, which is most of real ML work |
| — | Artificial Intelligence | A lecture between Weeks 7 and 8 that bridges to CS50 AI |
| 8 | HTML, CSS, JavaScript | Building interfaces for AI products |
| 9 | Flask | Web apps that can serve a model |
| 10 | The End | The course's closing lecture |
| — | Final project | Build something; consider a small AI-powered app |
Week list from cs50.harvard.edu/x, checked November 2026; confirm against the current syllabus.
Option B: CS50P, Introduction to Programming with Python (about 8–10 weeks)
Functions, conditionals, loops, exceptions, libraries, unit tests, file I/O, regular expressions and object-oriented programming, all in Python. Less computer-science depth than CS50x. CS50 AI asks for CS50x or about a year of Python, so after CS50P, write Python on your own for a while (Phase 0's Kaggle courses help) before you start it.
Tips for CS50
- Do every problem set; the lectures alone won't make you able to code.
- Use CS50.ai (the CS50 Duck), the course's own AI tutor, which is designed to guide rather than give answers. Don't paste problem sets into general chatbots; CS50's academic honesty policy forbids it, and you'd skip the learning.
- Expect 10–20 hours a week. Some weeks (Memory, Data structures) take longer.
- Join the CS50 Discord or Ed forum when stuck for more than an hour.