Python Concepts ( Tuple & Set)

Tuples are ordered collections of elements that are unchangeable. A tuple is just like a list only that it is immutable. It is like the read-only version of a list.

A tuple is created by enclosing the elements in a parenthesis “()”

Set

Set are unordered collections of elements that are unique. This means sets cannot contain duplicates. Sets are mutable, it is heterogeneous.

A set is created by enclosing the elements in a curly bracket “{}” or by using “set()”.

Scroll to Top