Read more
Introduction to List
Python programming language has four collections of data types such as List, Tuples, Set and Dictionary. A list in Python is known as a “sequence data type” like strings. It is an ordered collection of values enclosed within square brackets [ ]. Each value of a list is called as element. It can be of any type such as numbers, characters, strings and even the nested lists as well. Th e elements can be modifi ed or mutable which means the elements can be replaced, added or removed. Every element rests at some position in the list. Th e position of an element is indexed with numbers beginning with zero which is used to locate and access a particular element. Th us, lists are similar to array
Programming in Python
Create a List in Python
In python, a list is simply created by using square bracket. Th e elements of list should be specifi ed within square brackets. Th e following syntax explains the creation of list
0 Reviews