bartc wrote:
On 24/04/2017 09:20, Robert L. wrote:

old = list[0]
list.slice_before{|n| [n-old>1,old=n][0]}.
map{|a| a.size<3 ? a.join(",") : [a[0],a[-1]].join("-")}.
join ","

Is this supposed to be Python code?

I think it's Ruby. Maybe posted to the wrong group?

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to