Reply To: frozenset

by

example :

fruits = {‘apple’, ‘banana’, ‘cherry’}
x = frozenset(fruits) #
x[1] = “strawberry” #Attempting to modify a frozenset will result in a TypeError

# If you need to modify the set, we need to use a regular set instead

fruits.add(“strawberry”)

print(fruits)

Get In Touch