Given the integers N and M, can you print all numbers from N to M comma-seperated? The hitch is to use one single expression.
The output for N=23 and M=42 should look like this:
23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42
I'll start with Ruby:
puts (23..42).to_a.join(', ')
n..m
vs23..42
, “,” vs “, ”, quoted vs unquoted output, maybe with or without trailing separator. I know, it is not code-golf anymore, but I think the answer still should be somehow comparable. \$\endgroup\$