Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← 03-52 List Power Solution

dummy description

Get Embed Code
3 Languages

Showing Revision 1 created 05/04/2012 by Amara Bot.

  1. We're just applying the length function to all these strings
  2. and friends--1, 2, 3, 4, 5, 6, 7--has 7 characters in it,
  3. so we're just going to get a 7.
  4. This approach to defining a list where you use square brackets--
  5. but instead of explicitly listing the elements list a formula
  6. that's applied to every element in another list--is called a list comprehension.
  7. We comprehend the new list to be made out of transformations
  8. of the elements in the old one.