list | string | dict | tuple | set | |
---|---|---|---|---|---|
mutable? | mutable | immutable | mutable | immutable | mutable |
declaration | 中括號(square brackets) | 單引號(')或雙引號(") | brackets(大括號) | 括號(parentheses) | brackets(not empty) |
type constructor | list() | dict() | tuple() | set() | |
comprehensions | yes | yes | yes | ||
indexed | yes | yes | yes, by key | yes | no |
sliced | yes | yes | no | yes | no |
ordered? | ordered | X | unordered | ordered | unordered |