#100DaysOfCode in Python Transcripts
Chapter: Days 16-18: List comprehensions and generators
Lecture: Lesson introduction
0:00 Welcome back to the 100 days of Python.
0:02 In the coming three days I will guide you
0:04 through list comprehensions and generators
0:07 two of my favorite features of the language.
0:09 We're going to look at how you can make
0:12 a for loop with an embedded if statement
0:15 more Pythonic by using list comprehensions,
0:19 then we will load in Harry Potter
0:21 and use list comprehensions to filter out
0:23 non valid and stop words.
0:26 Next up, generators.
0:28 We start very simple with the concept
0:31 of the yield statement writing a simple generator,
0:34 we look at the stop iteration exception,
0:37 and how the for loop catches that for you.
0:40 We move on to more interesting examples
0:43 and finally compare performance of lists
0:46 and generators, because if your data set grows
0:50 you definitely want to know about generators.
0:52 The second day I have practical exercises
0:56 to train your new gained list comprehension
0:59 and generator skills.
1:01 The third day I will show you solutions to those
1:04 exercises and I challenge you to take
1:07 a more advanced generator exercise
1:10 replicating Unix pipelines and it will be a lot of fun.
1:14 So, lets dive straight into those two Python power tools.