Chapter 9: Conclusion
You’ve reached the end of the book. This chapter recaps what each chapter covered, suggests projects to practice with, and points you to good places to keep learning.
Recap of key concepts learned
- Introduction: where Python came from, what makes it popular, how to install it, and how to write and run your first program.
- Chapter 1: Python Basics: Python’s basic syntax, the core data types (numbers, strings, booleans and
None), converting between types, printing with f-strings, and arithmetic, comparison, logical and bitwise operators. - Chapter 2: Control Flow: making decisions with
if,elif,elseandmatch, repeating work withforandwhileloops, and organizing code into functions with parameters, return values and scope. - Chapter 3: Working with Data Structures: lists, tuples, dictionaries, sets and bytes, when to use each one, and comprehensions for building them concisely.
- Chapter 4: Working with Data: sorting, filtering and aggregating data, reading and writing text and JSON files, and handling errors with
try,except,elseandfinally. - Chapter 5: Object-Oriented Programming: classes and objects, inheritance and polymorphism, encapsulation, and modern conveniences such as properties and data classes.
- Chapter 6: Advanced Python Features: generators and iterators, decorators, concurrency, modules and packages, dates and times, databases with
sqlite3, and regular expressions. - Chapter 7: Applications of Python: how Python is used for data analysis, web development, automation and scientific computing, and the main libraries for each.
- Chapter 8: Tips and Tricks: writing clean code that follows PEP 8, virtual environments and packages, testing, debugging, and the common mistakes to avoid.
Where to go from here
The fastest way to get better at Python is to build things you care about. Pick a small project, finish it, then make it a little bigger. A few ideas, roughly from easiest to hardest:
- Expense tracker: read expenses from a CSV file, total them by category, and print a monthly summary.
- Quiz game: store questions in a JSON file, ask them in a random order, and keep score.
- File organizer: sort the files in a folder into subfolders by file type with
pathlib. - Weather report: fetch a forecast from a public weather API with
requestsand print it neatly. - To-do app: save tasks in an SQLite database and add commands to add, complete and list them.
- Web app: turn one of the projects above into a small website with Flask.
When you get stuck, read the error message carefully, search for it, and try the smallest piece of code that shows the problem.
Resources for further learning
- Python documentation: the official documentation covers the whole language and standard library. Its tutorial is a good next step after this book.
- Online tutorials and courses: Real Python has in-depth articles on almost every topic. Courses are also available on Codecademy, Coursera and edX.
- Books: Python Crash Course by Eric Matthes (projects for beginners), Automate the Boring Stuff with Python by Al Sweigart (practical automation, free to read online), and Python Data Science Handbook by Jake VanderPlas (data analysis, free to read online).
- Communities: ask questions and learn from others on the Python Discourse forum, the Python subreddit or the Python Discord server.
- Other books on this site: Regular Expressions for All goes much deeper into the pattern matching introduced in Chapter 6, and Programming for All: SQL Edition covers the databases you met there.
Happy coding!