Lists are ordered collections. Sets are unordered collections.
A tuple is one of the built-in data types used to store collections of items. It’s similar to a list but with a key difference: tuples are immutable, meaning once created, their elements cannot be changed, added, or removed.
immutable: that cannot be changed; that will never change
Similarities of sets and dictionaries:
- Both can be modified after creation
- Both are defined with curly brackets
- Both are unordered collections
Source mainly from Microsoft Copilot
沒有留言:
發佈留言