GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing codescracker.com — Python frozenset() function
Python frozenset() functionThe frozenset() function in Python is used to create frozenset. For example: x = (32, 43, 53, 534) y = frozenset(x) print(y) The output will be: frozenset({32, 43, 53, 534})
Python frozenset() function syntaxThe syntax of the frozenset() function in Python, is: frozenset(iterable)
where iterable refers to an iterable object like a list, tuple, set, etc. Python frozenset() function exampleThe program given below is an example of the frozenset() function in Python. mylist = ["codes", "cracker", "python", "programming"] fs = frozenset(mylist) print(fs) mydict = {"Day": "Sun", "Month": "Nov", "Year": "2021"} fs = frozenset(mydict) print(fs) The screenshot below shows an example of the output from this Python program, which shows how the frozenset() function works: Advantages of the frozenset() function in Python
Disadvantages of the frozenset() function in Python
« Previous Function Next Function » Practice Quizzes
Test your programming and computer science knowledge with interactive MCQs and topic-based quizzes. Popular Topics
Explore the most popular programming and computer science tutorials on CodesCracker. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |