Folders and files
| Name | Name | Last commit date | ||
|---|---|---|---|---|
Repository files navigation
This function was created as part of a codewars challenge and I thought it may be of use in various applcations. The function takes a ordered list of numbers eg: [-6, -3, -2, -1, 0, 1, 3, 4, 5, 7, 8, 9, 10, 11, 14, 15, 17, 18, 19, 20] and returns the range: "-6,-3-1,3-5,7-11,14,15,17-20" If the data that is being received is not ordered, simply use Python's sorted() or .sort()