Detecting consecutive integers in a list
I have a list containing data as such: [1, 2, 3, 4, 7, 8, 10, 11, 12, 13, 14] I’d like to print out the ranges of consecutive integers: 1-4, 7-8, 10-14 Is there a built-in/fast/efficient way of doing this? Answers: Thank you for visiting the Q&A section on Magenaut. Please note that all the … Read more