Python ListSetTuple Dict
Python ListSetTuple Dict
The list can be Tuple can be The set can be The dictionary can
represented by [ ] represented by ( ) represented by { } be represented by { }
A setA
A list can be created Tuple can be created A dictionary can be
dictionary can be
using using created using
created using
the list() function the tuple() function. the dict() function.
the set() function
Dictionary is ordered
List is ordered Tuple is ordered Set is unordered (Python 3.7 and
above)
# Set
s = set()
# Tuple
t = tuple(l)
# Dictionary
d = {}