Python Programming
About Lesson

List is one of the in-built data structures providing by Python. List can be created with a list of values within square brackets. The data items of list need not to be of same data type. It means a list can be created as all elements as same data type or different data types.

Example:
L1 = [‘Maths’, ‘Science’, 1993, 2000];
numList = [1, 2, 3, 4, 5 ];
alphList = [“a”, “b”, “c”, “d”]

An empty list can also be created like below
L1=[]

A list can also be an element of another list. This is known as Nested List

L1=[1,[2,3,4],[3,4,5]]

A list can also be created using an existing list.
L1=[1,2,3]
L2=[L1,4]

You cannot copy content of this page