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

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -