# List comprehensions and generators

## Day 1: Ready to learn some powerful, Pythonic concepts?

> List comprehensions and generators are in my top 5 favorite Python features leading to clean, robust and Pythonic code.

Welcome to this lesson. In today's videos you will learn two powerful techniques you can use in Python: list comprehensions and generators.

I prepared a [Jupyter notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/16-18-listcomprehensions-generators/list-comprehensions-generators.ipynb) so you can follow along with this lesson.

## Day 2: Practice!

Look at your code and see if you can refactor it to use list comprehensions. Same for generators. Are you building up a list somewhere where you could potentially use a generator?

[My notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/16-18-listcomprehensions-generators/list-comprehensions-generators.ipynb) has an exercise to sink your teeth in. Please try it and tomorrow I will discuss the solution.

## Day 3: Solution / simulate unix pipelines

I will detail the solution of yesterday's exercise [in my notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/16-18-listcomprehensions-generators/list-comprehensions-generators.ipynb)

Today if you have time left, I encourage you to try another exercise [on our platform](https://pybitesplatform.com):

- [Parse a list of names](https://pybitesplatform.com/bites/parse-a-list-of-names/)
- [Dictionary comprehensions are awesome](https://pybitesplatform.com/bites/dictionary-comprehensions-are-awesome/)

If you still have time left, or you prefer to practice generators check out this cool blog code challenge: [Code Challenge 11 - Generators for Fun and Profit](https://pybit.es/articles/codechallenge11/)

## Time to share what you've accomplished!

Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag **#100DaysOfCode**.

Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.

See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).
