You can create list inside the list as:
Accessing the list:
We can access the list in different ways.
- Through indexing
- Through negative indexing
Let's consider the example:
While accessing the list, when we try to access the list elements with the index which is not
present, leads to 'Index Error'.
In the above example, the length of 'list' is 3 and list 'index' ranges from 0 to 2.
When trying to access list with index '3' results in Index Error: list index out of range.
Index Error: list index out of range can be handled by using try and except method