Creating an empty set
objects = set()
print(objects)
print(type(objects))
other = {}
print(other)
print(type(other)) # This is an empty dict and not a set!!!!
Output:
set()
<class 'set'>
{}
<class 'dict'>
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
objects = set()
print(objects)
print(type(objects))
other = {}
print(other)
print(type(other)) # This is an empty dict and not a set!!!!
Output:
set()
<class 'set'>
{}
<class 'dict'>