3 ms·
It's range that gets me all the time, some make the end inclusive, some exclusive. Clojure (range 1 10) ;=> (1 2 3 4 5 6 7 8 9) C# Enumer
by LandR 6y ago
It's range that gets me all the time, some make the end inclusive, some exclusive.
Clojure
(range 1 10)
;=> (1 2 3 4 5 6 7 8 9)
C#
Enumerable.Range(1, 10).PrintAll();
1 2 3 4 5 6 7 8 9 10
Ruby
(1..10).each { |n| puts n }
#=> 1 2 3 4 5 6 7 8 9 10
Python
for i in range(1, 10):
print(i, end=', ')
=> 1 2 3 4 5 6 7 8 9