w3resource
w3resource logo

Python: frozenset() function

(追記) (追記ここまで)
(追記) (追記ここまで)

frozenset() function

The frozenset() function returns a new frozenset object, optionally with elements taken from iterable.

Note: frozenset is a built-in class.

Version:

(Python 3.2.5)

Syntax:

frozenset([iterable])

Parameter:

Name Description Required /
Optional
iterable An iterable object, like list, set, tuple etc. Required

Return value:

frozenset object.

Example: Python frozenset() function

# tuple of words
words = ('apple', 'orange', 'mango', 'banana')
froSet = frozenset(words)
print('The frozen set is:', froSet)
print('The empty frozen set is:', frozenset())

Output:

The frozen set is: frozenset({'apple', 'mango', 'orange', 'banana'})
The empty frozen set is: frozenset()

Pictorial Presentation:

Python: Built-in-function - frozenset() function

Python Code Editor:

[フレーム]

PREV : format()
NEXT : getattr()

Test your Python skills with w3resource's quiz



Follow us on Facebook and Twitter for latest update.

(追記) (追記ここまで)


(追記) (追記ここまで)
(追記) (追記ここまで)


AltStyle によって変換されたページ (->オリジナル) /