Getting number of elements in an iterator in Python -
Know how many elements exist in python in Python, normally, without each and again without counting ?
No it is not possible.
Example:
Import random atf (N): in xrange (n): if random.randint (0, 1) == 0: produce i iterator = Gen (10)
The length of the Iterator
is unknown until you move it again.
Comments
Post a Comment