Range returns a list while xrange returns a
In the first case you have all items already generated(this can take a lot of time and memory) while in the second you get the elements one by one e.g. only one element is generated and available per iteration.
No comments:
Post a Comment