In python lists, data types are similar to arrays in C. It can contain data of different types. A comma separates the values (,) and it is enclosed within square braces ( [ ] ). We can use the slice operator (:) to access the data on the list. The plus (+) operator and the repetition operator(*) act the same way as in the strings.
The list items are indexed, and the first item has index , the second has , and so on. If you try to access a list index that is not available, then the IndexError will occur. Additionally, the index can only be an integer, and if you try accessing some other type, then the TypeError will occur.
It means that there is some defined order that the list items follow and that order cannot be changed. Further, if some new items are added to the list, they add at the end of the list and nowhere in between.
It means that the list items can be changed and manipulated. You can add, delete, sort the list items.
To identify the length of a list, you must pass the len() function and fill the brackets with the list name whose length is to be identified.
Python list items can contain any data type, including integers, floating value, character, strings, Boolean, etc. You can create a list with only one type of data type or a mixture of several data types.
['Knowledge2life 1', 'Knowledge2life 2', 'Knowledge2life 3']