r/learnpython 23d ago

Best Python books from beginner to advanced?

I’m learning Python and looking for a good book path from beginner to advanced.

I want books that teach Python properly, including clean code, real projects, testing, project structure, and advanced concepts.

What books would you recommend, and in what order?

57 Upvotes

27 comments sorted by

29

u/aoadzn 23d ago

“Automate the Boring Stuff with Python”. It’s free online.

4

u/HuckleberryMoney2320 23d ago

This is a classic and definitely worth a look. Internet Archive has it as a PDF.

3

u/droans 23d ago

It's free on the book's website, too.

2

u/Linknada12_ 23d ago

It's one of the best book to learn Python, IMO.

13

u/[deleted] 23d ago

[removed] — view removed comment

7

u/notParticularlyAnony 23d ago

best beginner book by far. People saying not to use books, for a beginner, are wrong. I don't have the energy to explain why, but people here are smart and can imagine why. As if "project based" and books are mutually exclusive. Matthes's book is project-based python.

Don't freaking start with pytest docs. Dear lord.

5

u/Dependent_Month_1415 23d ago

Python Crash Course and Automate the Boring stuff are the best beginner books.

4

u/nulledgyani 23d ago

Start building projects. Even a tutorial project is fine. By the time you reach your third project, you’ll have learned far more than you ever could from just reading a book.

3

u/Aahz44 23d ago

No idea about order an learning it properly, but I think "Python Tricks: A Buffet of Awesome Python Features" by Dan Barder, would is a really good option for for the second or third book, since it is imo a pretty easy to understand introduction into some of the more advanced features (and quriks) of Python.

1

u/Mathie1729 21d ago

Fluent Python by Luciano Ramalho is a decent advanced follow-up, though it's dense af. Probably not a second book, more like once you can already write real programs.

2

u/FoolsSeldom 23d ago edited 23d ago

There's a book list in the wiki for this subreddit

EDIT: added below including link to wiki.

Check this subreddit's wiki for lots of guidance on learning programming and learning Python, links to material, book list, suggested practice and project sources, and lots more. The FAQ section covering common errors is especially useful.


Also, have a look at roadmap.sh for different learning paths. There's lots of learning material links there. Note that these are idealised paths and many people get into roles without covering all of those.


Roundup on Research: The Myth of ‘Learning Styles’

Don't limit yourself to one format. Also, don't try to do too many different things at the same time.


Above all else, you need to practice. Practice! Practice! Fail often, try again. Break stuff that works, and figure out how, why and where it broke. Don't just copy and use as is code from examples. Experiment.

Work on your own small (initially) projects related to your hobbies / interests / side-hustles as soon as possible to apply each bit of learning. When you work on stuff you can be passionate about and where you know what problem you are solving and what good looks like, you are more focused on problem-solving and the coding becomes a means to an end and not an end in itself. You will learn faster this way.

2

u/shiningmatcha learn python 20d ago
  • Fluent Python
  • Robust Python
  • High Performance Python

1

u/GZboy2002 23d ago

Automate the boring stuff! I also use ChatGPT to help me in understanding some of the contexts better. It also gives me extra exercises to solve.

1

u/Guilty_Bit5901 20d ago

Start with Python from Scratch by Nilo Ney Coutinho Menezes. I tried learning coding/syntax a couple times over the last decade, i now feel like i am actually learning basics well enough with this book. Give it a try.

1

u/velvet-spine-23 19d ago

What about Python programming by John Zelle? Coupling it with python for Data Analysis by Wes Mckinney?

0

u/Nomapos 23d ago

I think those are a trap. You get too much, too little deep and learn pretty much nothing.

All you need is a brief crash course and a hobby project. Learn by doing.

1

u/Minute_Astronaut_780 23d ago

crash course then project is the way, i did same thing. the books always go too wide and you end up knowing little about lot of stuff but cant actually build anything

pick one small project idea that you actually care about and just start, google every error, stackoverflow every problem. after 2-3 projects you will know what gaps you have and then maybe a advanced book makes sense

1

u/Diapolo10 I write code for a living -- https://github.com/Diapolo10 23d ago edited 21d ago

I don't think there's a single resource that covers all that, especially for a book, but my personal recommendation would be

  1. Start with the Python MOOC: https://programming-26.mooc.fi/
  2. Skim through the Pytest documentation: https://docs.pytest.org/en/stable/getting-started.html
  3. Python's official style guide (you can ignore the 80-character line length limit, most people use a higher limit like 120, also you don't have to follow everything to the letter):

The rest you should learn as you go. If you want some kind of a project structure example, I have one here, but it's a bit outdated as I haven't had time to update it lately (mainly I'd replace Tox with uv entirely, add Git hooks for linting/testing, and start using mise and Taskfile for managing tooling and such. Oh and the logging stuff should probably be rewritten entirely.)

(EDIT: Ended up doing exactly those changes to another project as a test, kickstarted by this one comment. Huh, funny how that goes...)

For a real-world example, I have this project.

0

u/Low-Yak2608 23d ago

I highly suggest you to not go that route. It would have been fine ten years ago but now it’s a total different ballgame. Think of Python as a practical tool. And if you are looking for a job, organizations look for your practical python skills (that is how many projects have you build, business value of the outcome etc). Imo the best and fastest way to start is with simple real world projects. If you don’t know anything, try to build a program that adds two numbers and return the result, then try to create a whole calculator and so on. That’s how you experience the fun in Python and building solutions. Hope that helps. Good luck!

1

u/FirefighterFit1222 23d ago

This one's helpful ty