TUPLES
S.Madhumalar
Assistant Professor
C.P.A College, Bodinayakanur
Tuples
Examples
Why?
Tuples are immutable
Things that do not work
Sorting tuples
Tuples are immutable!
sorted( ) returns a list!
Most other things work!
The reverse does not work
Converting sequences into tuples
SETS
Sets
Sets do not contain duplicates
Sets are immutable
Union of two sets
Sets have no order
Sets do not support indexing
Examples
Boolean operations on sets (I)
A
B
Boolean operations on sets (II)
A
B
Boolean operations on sets (III)
A
B
Boolean operations on sets (IV)
A
B
Boolean operations on sets (V)
Boolean operations on sets (VI)
DICTIONARIES
Very useful!
Dictionaries (I)
Usage
Dictionaries are mutable
Keys must be unique
Displaying contents
Updating directories
Returning a value
Removing a specific item (I)
Removing a specific item (II)
Remove a random item
Summary
Mutable aggregates
Immutable aggregates
Ordered aggregates
Other aggregates