Lists in Python

ubaid darwaish

We have seen previously how we can store data in various data types in python like int, float, integer. Now what if we need to store multiple values instead of just one. That is where Lists, Tuples, Dictionaries and Sets come in handy. In this section we will discuss about Lists.

List as the name suggests, contains list of elements
These elements can be of mixed types (numeric/char)
List can contain another list as an element
Lists are iteretable( have index that can be used to move from one element to another)
Lists are mutable and can be modified
List are defined in square brackets with each item separated by comma(,)

Contributed by: Ubaid Darwaish