Home Page
About Us


Related to functions or methods that return enumerations or enumerated-types


Xrange is a Python function that, unlike the traditional 'range' function, creates an iterator object rather than a list.



If you measure properly you ll see there s essentially no difference enumerate is microscopically faster than xrange in this example but well within noise

from question  

Why is Python's enumerate so slow?

Enumerate is also more appropriate than xrange

from question  

Optimise comparison between two lists, giving indices that differ

Enumerate is more pythonic but xrange is fine here too

from question  

Python Code to Create Sum of Neighbors and itself in the original list

Or use xrange len letters to generate sequence of indices;but enumerate is more concise and faster

from question  

Get location of "c" in for loop?

Why is enumerate slower than xrange + lst i

from question  

Why is Python's enumerate so slow?

Back to Home
Data comes from Stack Exchange with CC-BY-SA-4.0