Let us move to the next tutorial in the Python Tutorials for Beginners. This Python beginner tutorial explains lists in Python. The tutorial also shows a variety of operations that we can do on Python lists.
What are lists? In Python programming, a list is a group of values. These values are called items. The items are commonly of the same data type like all integers or all floats. But, it is possible for the items to be of different list data types like strings, integers or floats. Lists are mutable, meaning that we can change a list. A list may have another list as an item. The lists which are items of another list are called nested lists. The list syntax is:
[item0, item1, item2,..., itemn]
In the above list format, note that the list is put between square brackets [ and ]. Within the list, the items are separated by commas. The item indexes start from 0. Now, let us see Python list examples and list operations with Python examples.
What are lists? In Python programming, a list is a group of values. These values are called items. The items are commonly of the same data type like all integers or all floats. But, it is possible for the items to be of different list data types like strings, integers or floats. Lists are mutable, meaning that we can change a list. A list may have another list as an item. The lists which are items of another list are called nested lists. The list syntax is:
[item0, item1, item2,..., itemn]
In the above list format, note that the list is put between square brackets [ and ]. Within the list, the items are separated by commas. The item indexes start from 0. Now, let us see Python list examples and list operations with Python examples.