Py Slides 4
Py Slides 4
Py Slides 4
Python - Lists
• The list is a most versatile datatype available in Python,
which can be written as a list of comma-separated values
(items) between square brackets. Good thing about a list that
items in a list need not all have the same type:
• Creating a list is as simple as putting different comma-
separated values between squere brackets. For example:
list1 = ['physics', 'chemistry', 1997, 2000];
list2 = [1, 2, 3, 4, 5 ];
list3 = ["a", "b", "c", "d"];