3 ms·
That's nearly identical to Python's approach, too. It doesn't have C-style loops, just ones that consumer iterators. for i in range(10): print(i) cons
by kstrauser 2y ago
That's nearly identical to Python's approach, too. It doesn't have C-style loops, just ones that consumer iterators.
for i in range(10):
print(i)
consumes 1 value at a time from the `range(10)` generator. `for` has no special knowledge of numbers or ranges or any of that.