Answers for "initialize empty set in python"

0

empty set in python

# Important: This syntax will create an empty dictionary and not an empty set
a = {}
print(type(a))

# An empty set can be created using the below syntax:
b = set()
print(type(b))
Posted by: Guest on January-12-2022
0

initialize empty set in python

# to create an empty set we use the set() method without any arguements
emptyset = set()


# we can't use {} to create a set (rather a dictionary is created)
d = {}
# type(d) --> <class 'dict'>
Posted by: Guest on January-20-2022

Code answers related to "initialize empty set in python"

Python Answers by Framework

Browse Popular Code Answers by Language