Beginners who've finished a basic programming book or a course often wonder what they should do next. This article titled I know how to program, but I don't know what to program succinctly captures the feeling.
After solving exercises that test your understanding of syntax and common logical problems, working on projects is often recommended as the next step in the programming journey.
Working on projects that'll help you solve real world use cases would be ideal. You'll likely have enough incentive to push through difficulties instead of abandoning the project.
Sometimes though, you just don't know what to work on. Or, you have ideas, but not sure how to implement them, how to break down the project into manageable parts, etc. In such cases, a learning resource focused on projects can help.
This book presents five beginner to intermediate level projects inspired by real world use cases:
- Enhance your CLI experience with a custom Python calculator
- Analyzing poll data from a Reddit comment thread
- Finding typos in plain text and Markdown files
- Creating a GUI for evaluating multiple choice questions
- Square Tic Tac Toe — creating a GUI game with AI
To test your understanding and to make it more interesting, you'll also be presented with exercises at the end of each project. Resources for further exploration are also mentioned throughout the book.
You should be comfortable with Python syntax and familiar with beginner to intermediate level programming concepts. For example, you should know how to use data types like
set, etc. Features like exceptions, file processing, sorting, comprehensions, generator expressions, etc. Classes, string methods and regular expressions will also be used in this book.
If you are new to programming or Python, I'd highly recommend my comprehensive curated list on Python to get started.
- The examples presented here have been tested with Python version 3.9.5 and GNU bash version 5.0.17
- Code snippets that are copy pasted from the Python REPL shell have been modified for presentation purposes. For example, comments to provide context and explanations, blank lines to improve readability and so on.
- A comment with filename will be shown as the first line for program files.
- External links are provided for further exploration throughout the book. They have been chosen with care to provide more detailed resources on those topics as well as resources on related topics.
- The practice_python_projects repo has all the programs and related example files presented in this book, organized by project for convenience.
- Python documentation — manuals and tutorials
- /r/learnpython/ and /r/Python/ — helpful forums for Python programmers
- stackoverflow and unix.stackexchange — for getting answers on Python, Bash and other pertinent questions
- tex.stackexchange — for help on pandoc and
- Cover image:
- Warning and Info icons by Amada44
- pngquant and svgcleaner for optimizing images
- Inkscape for favicon
- mdBook — for web version of the book that you are currently reading
I would highly appreciate if you'd let me know how you felt about this book, it would help to improve this book as well as my future attempts. Also, please do let me know if you spot any error or typo.
Sundeep Agarwal is a freelance trainer, author and mentor. His previous experience includes working as a Design Engineer at Analog Devices for more than 5 years. You can find his other works, primarily focused on Linux command line, text processing, scripting languages and curated lists, at https://github.com/learnbyexample. He has also been a technical reviewer for Command Line Fundamentals book and video course published by Packt.
List of books: https://learnbyexample.github.io/books/
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License
Code snippets are available under MIT License
Images mentioned in Acknowledgements section above are available under original licenses.
See Version_changes.md to track changes across book versions.