Python
Python Lists: Creating, Indexing and Slicing
A list is an ordered, changeable sequence that can hold anything. Indexing, slicing and slice assignment cover most of what you will ever do with one.
Creating, indexing, slicing and mutating lists, list methods, nesting and copying.
3 notes
A list is an ordered, changeable sequence that can hold anything. Indexing, slicing and slice assignment cover most of what you will ever do with one.
Most list methods change the list in place and return None. Knowing which ones return a value and which do not prevents the most common list bug.
Lists of lists model grids and tables, copying them needs care, and a handful of patterns cover most real list work.