Python 3.15 ยท following the official tutorial

๐Ÿ Python Study Book

A beginner-friendly, chapter-by-chapter course through the whole official Python tutorial, written for people who already program in Java or JavaScript and want to know Python properly.

How to use this book

  • Read in order. The 16 chapters follow the official tutorial's structure. Each chapter only uses ideas from earlier chapters (or says where an idea is explained).
  • Type the examples. Every example was run with Python 3.15 and its output checked. >>> blocks are for the REPL; file blocks are scripts. Use the Copy button.
  • Do the exercises. Each chapter has 10+ exercises marked ๐ŸŸข easy, ๐ŸŸก medium or ๐Ÿ”ด hard, with hidden solutions. Try first, then peek.
  • Build the practice project. Exercises marked playground grow the playground/ folder, step by step, into the Chapter 16 expense tracker. The finished version is in playground/reference/. Start with Using the Playground.
  • Watch for the โ˜•/๐ŸŸจ boxes. They compare Python with Java and JavaScript, and point out the habits that cause bugs.
  • Test yourself. The Final Assessment draws 50 random questions from a pool of 1000, and scores you per chapter.
  • Practise beyond the book. The ๐Ÿงฉ Problem Set has 100 language-neutral problems (easy, medium, hard and OOP) with exact tests โ€” a great way to make Python stick.

๐Ÿ’ก Coming from Java or JavaScript, or rusty on the terminal? Start with Appendix A: From Java & JavaScript to Python for a side-by-side map of the languages, and Appendix B: Terminal, Paths & Text Encoding for the shell basics every Python program relies on.

๐Ÿ“ Setup: install Python 3.15 (Chapter 1 shows how) and check it with python3 --version. Then clone the practice project, coder-hop/python-book-playground, with git clone https://github.com/coder-hop/python-book-playground.git playground. Some examples (match, comprehension unpacking, lazy import, frozendict) won't run on older versions.

Keep practising