Learning overview
- Estimated time
- 4 minutes
- Difficulty
- Beginner
- Prerequisites
- No prior experience required
- Learning outcome
- Explain python using a clear mental model · Apply python in practical Python work
- Last updated
- July 18, 2026
Use lists as mutable sequences
Indexes begin at zero, negative indexes count from the end, and slices create new lists. Append adds one item, extend adds items from an iterable, and pop removes and returns an item.
skills = ["HTML", "CSS"]
skills.append("Python")
skills.extend(["SQL", "Git"])
first_two = skills[:2]
last = skills[-1]Transform clearly with comprehensions
A list comprehension is effective for one readable transformation and optional filter. Use a regular loop when logic needs multiple steps, logging, or exception handling.
scores = [72, 38, 91, 64]
passing = [score for score in scores if score >= 40]
labels = [f"{score} points" for score in passing]Copy and sort deliberately
list.copy and slicing produce shallow copies, so nested objects remain shared. sorted returns a new list; list.sort mutates in place and returns None.
Frequently asked questions
What is the difference between append and extend?
Append adds its argument as one item. Extend iterates over its argument and adds each item to the list.
Does list.copy create a deep copy?
No. It copies the outer list only. Nested mutable values remain shared; use copy.deepcopy only when deep-copy semantics are truly required.
Topic graph
A taxonomy-generated path through this subject.
Related courses
Related learning
Recommended automatically from shared technologies, topics, intent, and difficulty.
Related Guides
Related Tutorials
Related Glossary
Related Cheatsheets
Related Projects
Related Interview Questions
Related reading
Hand-picked companion pages that deepen this topic.
Your next steps
