Lists in Python

Python list is a mutable sequence type that represents an ordered set of elements of different types

List Updated 11 Sep 2016 1 min read

Overview

Lists in Python represent ordered sets of elements with finite length. In a list, elements with same value can occur multiple times. Lists are a type of mutable sequences in Python, as any element can be added to or removed from a list.

As with any sequence, the elements in the lists are identified with an index ranging from 0 to length-1 of the list. Slicing operations are supported in lists and they produce new lists or sequences which are subsets of the original list.

List Methods

python
List Construction
append(element)
insert(position, element)
extend(anotherList)
remove(element)
pop(position)
clear()
copy()
sort()
reverse()
index(value)
count(value)