question archive In Python, what is the primary difference between a list and a tuple? A list can have the same item repeated whereas all elements of a tuple must by unique
Subject:Computer SciencePrice:1.87 Bought7
In Python, what is the primary difference between a list and a tuple?
A list can have the same item repeated whereas all elements of a tuple must by unique. |
||
Once created, a list is mutable whereas a tuple is immutable. |
||
Lists can be used as dictionary keys whereas tuples may not be used as dictionary keys. |
||
Lists can hold arbitrary data types (numbers, strings, etc.) whereas tuples can only hold numbers. |
Purchased 7 times