I'm a beginner who started studying Python, and the Python for statement tells me to write an iterable object after the in.However, a set type that is not interable can be written after the in.Also, the frozen function that generates the frozen set can be generated even though the argument is interchangeable.What should I think?
python
The set
and frozenset
types are iterable
.The object that displays True in the following code is iterable
.
s=set()
try:
iterator=iter(s)
print(True)
exceptTypeError as:
print(False)
iterable
About Terminology—Python 3.7.2 Documentation
iter
About Embedded Functions—Python 3.7.2 Document
© 2024 OneMinuteCode. All rights reserved.