Question: what is the difference between xrange and range in python?
Answer: The Difference Between xrange and range in Python The only difference is that range returns a Python list object and xrange returns an xrange object. ... It means that xrange doesn't actually generate a static list at run-time like range does. It creates the values as you need them with a special technique called yielding.