Almost three years ago, I released a book called "50 Days of Python: A Challenge a Day" (March 2022). The idea behind the book was to encourage people who want to improve their Python skills to commit to doing one challenge or two a day for 50 days. If they are not limited by time, they can do it quicker. There is no better way to learn than to tackle challenges. My goal was to write a book that has challenges that cover the fundamentals of Python in a gentle way. That is, I did not want the challenges to be intimidating for people that are just starting out. The book extensively covers Python topics at the basic and intermediate levels. If you have started learning Python, you may want to try these challenges. There are more than 80 challenges in this book.
Honestly, when I was writing the book, I hoped the book would be helpful to some, but I never anticipated the level of positive feedback and the impact it would have on so many learners' journeys. To see how many people have used the book to learn Python and achieve their coding goals is incredibly rewarding and humbling. In this article, I am going to share with you 5 challenges from the book that I think you should try.
1. Most Repeated Name and Sort by Last Name
On day 30, there are two challenges to complete. These challenges test your skills in sorting lists of strings. The first question asks that you find the most repeated name in a list. This is a straightforward question that you can solve using loops or built-in modules. Basically, the question assumes that there is only one most repeated name in the list. You can expand your solution to handle situations where there's a tie for the most frequent name in the given list. The extra challenge is asking that you sort a list of names by their last names. Can you sort strings of names by the last name? Try these challenges:
2. Reading CSV Files
This challenge tests your ability to handle files. It is important to know how to work with files if you are learning Python. CSV files are extensively used to store data. Do you know how to read and extract information from CSV files? In this challenge, you are asked to extract digits from a text saved as a CSV file. Can you solve this challenge?
3. Password Generator
Think about it: password generators are part of the internet now. Most websites generate a password for a user. This challenge tests your ability to set up a password generator that meets three different conditions. That sounds like a good question to practice conditional statements on. Try it out.
4. Spelling Checker
On Day 42, you are asked to create a spelling checker. Can you make one using the textblob module? You have to install and import this module to use it. The extra challenge is about creating an alarm using the winsound module. This is a good challenge to test your skills with working with time objects in Python.
5. Create a Database
If you are just starting out, this challenge is perfect for testing your skills to interact with databases. If someone gave you data and asked you to save it on a database, could you do it? On day 49, you are given data that you must save to a database. You are also required to write some queries to extract data from the table. This is a good challenge to flex your SQL skills. Give it a shot.
Final Thoughts
These challenges are just the tip of the iceberg. There are many other questions in this book to help you level up your Python skills. The answers to these challenges are in the book.
50 Days of Python A Challenge a Day