Community Data Science Workshops (Fall 2014)/Day 1 lecture: Difference between revisions
Content added Content deleted
imported>Mako (→Lists) |
imported>Mako (→Lists) |
||
Line 69: | Line 69: | ||
** e.g., <code>"z" in my_list</code> |
** e.g., <code>"z" in my_list</code> |
||
* slicing lists |
* slicing lists |
||
** the colon inside the [] is the ''slicing syntax'' |
|||
** e.g., <code>my_list[0:2]</code> is 0th up to, but not including, the 2nd |
** e.g., <code>my_list[0:2]</code> is 0th up to, but not including, the 2nd |
||
** e.g., <code>my_list[2:]</code> |
|||
** e.g., <code>my_list[:2]</code> |
|||
** e.g., <code>my_list[:]</code> |
|||
* strings are like lists |
* strings are like lists |
||
** len() |
** len() |