Python Lists
Python Lists
- Lists are ordered collection of data items.
- They store multiple items in a single variable.
- List items are separated by commas and enclosed within square brackets [].
- Lists are changeable meaning we can alter them after creation.
Example 1:
Output:
Example 2:
Output:
As we can see, a single list can contain items of different datatypes.