|
|
|
|
|
by applecrazy
2751 days ago
|
|
You're correct. It returns a list from from [a, b), but it's just another example of some expressive (albeit computationally inefficient) notation Python has. Edit: I take that back. Here's a section from Python's range() documentation: > The advantage of the range type over a regular list or tuple is that a range object will always take the same (small) amount of memory, no matter the size of the range it represents (as it only stores the start, stop and step values, calculating individual items and subranges as needed). So it may be a O(1) operation under the hood. |
|
Equivalent pseudocode: