Lists in python are a sequence of elements/objects
( character strings, numeric variable etc. )
enclosed within a square bracket and separated by a comma.
In :[1,2,3] Out:[1,2,3] In :my_list = ['a','b','c']
If we need to add more character to the end of the list we use the append method as shown below :
In :my_list.append('d') In :my_list Out:['a','b','c','d']
Note that to append a character at the end of the list we use the curve bracket and not a square bracket in the append method.
Even the list is indexed and will behave exactly like how we discussed indexing on the strings. If we have to grab the first item in the list it would be :
In :my_list Out:'a'
If I want to update ‘d’ as ‘data’ in my list I will have to :
In :my_list ='data' In :my_list Out:'a','b','c','data'
Note that if I have to update the 4th character I have to update the 3rd index position.
Nested Lists –
Python enables to have a list within a list as shown below
In  :nested = [1,2,[3,4]] In :nested Out:1,2,[3,4]
In order to retrieve elements within a nested list we can use the below syntax :
In :nested Out:4
The first square bracket above shifts pointer to the second list which is [3,4]. the next square bracket points to index number 1 of the nested list and retrieves 4.
Lets now move on to dictionaries in python.