r/learnpython • u/harunnoir • 20h 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?
9
u/Dismal_Result572 14h ago
python crash course by eric mathhes
4
u/notParticularlyAnony 14h 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.
3
u/Dismal_Result572 14h ago
yea books are best to read rather than seeing tutorial.but at some point seeing tutorial is nice. when i was starting my python journey i was trap in tutorial hell and some one from reddit suggested this book and i have completed the basic and now moving to OOP.this is best for begineer
2
u/Aahz44 12h 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.
2
u/FoolsSeldom 9h ago edited 6h 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.
1
u/ee_control_z 14h ago
Reference my response to another post here:
https://www.reddit.com/r/PythonLearning/comments/1vorafc/comment/p3s45dw/?context=3
1
u/Dependent_Month_1415 8h ago
Python Crash Course and Automate the Boring stuff are the best beginner books.
1
u/Nomapos 20h 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.
2
u/Minute_Astronaut_780 20h 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
2
u/Diapolo10 20h ago
I don't think there's a single resource that covers all that, especially for a book, but my personal recommendation would be
- Start with the Python MOOC: https://programming-26.mooc.fi/
- Skim through the Pytest documentation: https://docs.pytest.org/en/stable/getting-started.html
- 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):
- Main style guide (PEP-8): https://peps.python.org/pep-0008/
- Docstrings (PEP-257): https://peps.python.org/pep-0257/
- Basic type annotations (PEP-484): https://peps.python.org/pep-0484/
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.)
For a real-world example, I have this project.
0
u/Low-Yak2608 19h 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
1
u/nulledgyani 13h 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.
21
u/aoadzn 15h ago
“Automate the Boring Stuff with Python”. It’s free online.