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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -