Veda Bites are swipeable micro-lessons — each one teaches exactly one
idea. Here's a taste from this kit; the app has the full deck.
💡 Key Idea
What is a Python List?
The Swiss Army knife of data.
A list in Python is an ordered, mutable collection of items. It can hold elements of different types (integers, strings, even other lists) and is defined using square brackets `[]`. Lists are zero-indexed, meaning the first element is at index `0`.
↳ A Python list is an ordered, changeable sequence written as a comma-separated list inside square brackets.
📖 Definition
List Creation
Start with empty or filled.
Create a list by placing items inside `[]` separated by commas. An empty list is simply `[]` or using the `list()` constructor.
↳ Use square brackets or the list() constructor to create a list.
💡 Key Idea
Indexing and Negative Indexing
Start at 0, end at -1.
Access items by their position. The first item has index `0`, the second `1`, and so on. Python also supports negative indexing, where `-1` refers to the last item, `-2` to the second last, etc.
↳ Use positive indices from the start (0) and negative indices from the end (-1).