As you have learned in the List Comprehension lesson, list comprehensions allow you to efficiently perform iteration, storage, and even filtering based on conditional statements. List comprehensions are useful for a variety of things, so it is critical that you get sufficient practice and become skilled at identifying when to use them.
In this lab, you will practice constructing list comprehensions and using them to extract and filter information in a variety of scenarios. You will work on your own but remember the teaching staff is at your service whenever you encounter problems.
Open the main.ipynb
file in the your-code
directory. There are a bunch of questions to be solved. If you get stuck in one exercise you can skip to the next one. Read each instruction carefully and provide your answer beneath it.
Hint: If list comprehensions are still not so intuitive to you, you can solve any exercise first using loops and then transform then into a list comprehension.
main.ipynb
with your responses to each of the exercises.
Upon completion, add your deliverables to git. Then commit git and push your branch to the remote.
Warning: Make sure you have done the pull request, otherwise we won't be able to review your work.