πŸ”₯ Welcome to my blog! Latest updates available now. Visit daily! πŸ”₯ πŸ”₯ Click Here for Latest Updates – Visit My Blog πŸ”₯
πŸ”₯ Latest Updates πŸ“Š GP Grade Finder πŸ“’ Government Services Info πŸ†• New Schemes Updates

frozenset Data Type in Python

It is exactly same as set except that it is immutable. 

Hence we cannot use add or remove functions.


>>> s=(10,20,30,40)

>>> fs-frozenset(s)

>>> type(fs)

<class 'frozenset'> 5) >>> fs

frozenset((40, 10, 20, 30))

>>> for i in fs:print(i)

40 10 20 30

>>> fs.add(70)

AttributeError: 'frozenset' object has no attribute 'add' 

>>> fs.remove(10)

AttributeError: 'frozenset' object has no attribute 'remove'


No comments:

Post a Comment

Thank you Very Much.For Given Comment

Quatation of the Day 22-03-2026