Python Lists are created by assigning elements between brackets with a comma separating each list element. Lists can be as large as required and can contain a mixture of data types; elements can even be another sequence type.
Elements in a list can be referenced by calling the list name followed by the index of the position between brackets or by referencing an index range just like with Strings.
We can treat each List element as a separate variable that then can be used in other tasks just like regular variables can be.
Just like all sequence data types, we can use the Pyton LEN function to find out how elements are in a list.
Python Lists come with a couple of functions that allow us to quickly add and remove elements. To add an element to the end of a list we simply use the Append function and the new element we want to add.
Similarly, to remove an element we can use the Remove function.
In the case of the Remove function, it’s worth remembering that removing an element will cause all values that were stored in later indexes to be moved up to an earlier position in the list.
Finally, we can reassign any part of a list with another value, as we can with regular variables.
Tuples are very similar to Python Lists and are assigned by declaring the Tuple elements within open brackets, separated by a comma.
Python Tuples can be comprised of different data types, can be referenced using index numbers or index ranges and we can use the Python LEN function to determine the length of a Tuple. However unlike Python Lists, Python Tuples are constant, meaning they cannot be changed. If we attempt to reassign any element within a Tuple we will get a Type Error.