Notes / Python / Lists

Lists in Python — Revision Notes

A quick-reference cheat sheet: definition, syntax, example, common mistakes and an interview tip.

intermediate 📖 2 min revision

Definition

📌 Lists The list is Python's most-used data structure — an ordered, mutable (changeable) collection that can hold items of any type, and grow or shrink as needed.

Syntax

syntax
myList = [item1, item2, item3]
myList.append(item)
myList.remove(item)
myList[index]
myList[start:end]

Example

py
fruits = ["apple", "banana", "cherry"]
fruits.append("mango")
fruits.remove("banana")
print(fruits)
print("First:", fruits[0])
print("Slice:", fruits[1:3])

Output

output['apple', 'cherry', 'mango'] First: apple Slice: ['cherry', 'mango']

Important Points

Common Mistakes

Interview Tip

🎯 Before your interview List comprehensions are a favorite interview topic — be ready to rewrite a simple for-loop that builds a list as a one-line comprehension.
Back to notes Read full lesson →