On this page
article
Interview Q&A #6
Python Core interview question #6.
Category: Python Core
Question
[Python Core] Question #6: What is the difference between a list and a tuple?
Answer
Lists are mutable, tuples are immutable. Tuples can be dict keys and are faster for fixed data.
Expand your answer with examples from your projects and link to Interview Prep.
Follow-Up Questions
- Can you explain a trade-off involved?
- How would you test this in production?
- What could go wrong at scale?