Differences and Applications of List, Tuple, Set and Dictionary in Python - GeeksforGeeks
Differences and Applications of List, Tuple, Set and Dictionary in Python - GeeksforGeeks
The dictionary
The list can be Tuple can be The set can be can be
represented by [ ] represented by ( ) represented by { } represented by {
}
The dictionary
The list can use Tuple can use The set can use
can use nested
nested among all nested among all nested among all
among all
We use cookies to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy
Policy
List Tuple Set Dictionary
Dictionary is
List is ordered Tuple is ordered Set is unordered ordered (Python
3.7 and above)
Below is the program for the implementation of list, tuple, set, and
dictionary:
Python3
# Lists
l = []
# Set
We uses cookies
= set()to ensure you have the best browsing experience on our website. By using
our site, you acknowledge that you have read and understood our Cookie Policy & Privacy
# Adding element into set Policy
s.add(5)