2. INTRODUCTION
• List is used to store different
elements of different data
types.
• While using lists there is no
need to specify the size in
advance like arrays.
3. CREATING A LIST
• List comprehension is
also one type of creating
a list..
• List comprehension is
an elegant and concise
way to create new
list from a existing list in
python.
• EXAMPLE:
L=range(1,10)
Print(L[3])
OUTPUT:4
6. OPERATORS
SLICING: CANCATENATION:
• The operator "+" use to
combine two lists.
• This is also
called"cancatenation".
• Example:
L1=[1,3,9]
L2=[5,7,6]
L3=L1+L2
Print(L3)
• Output:
REPETITION:
• The operator '*' repeats
a list for the given of
times.
• Example:
L=[1,2,3]
L1=L*3
Print(L1)
• Output:
[1,2,3,1,2,3,1,2,3]