List
Lists are mutable sequences used to store collections of items. This guide covers essential list operations and methods. The guide walks through Adding Elements, Removing Elements, Searching & Sorting. `list.append()` adds a single item to the end. `list.extend()` adds multiple items from an iterable. `list.insert()` adds at a specific position. List concatenation with `+` creates a new list. `list.pop()` removes and returns an item by index. `list.remove()` removes the first occurrence of a value. `list.clear()` empties the list. `del` statement removes by index or slice. `list.index()` finds the position of a value. `list.count()` counts occurrences. `list.sort()` sorts in-place while `sorted()` returns a new list. `list.reverse()` reverses in-place. The guide is organized into 3 sections that build on each other, each pairing a prose explanation with runnable code. Browse the individual functions covered by this guide in the List Methods category. Key APIs covered include list.append(), list.extend(), list.insert(), list.remove(), list.pop(), list.clear().