data looks like this:
data=["q11-23-45","q11-23-46","q11-23-47","b11-73-50","q12-93-55","p11-23-59","p11-23-60","p11-23-61"]
trying to get something like:
q11-23-45 to 47
b11-73-50
q12-93-55
p11-23-59 to 61
tried
a=[]
b=[]
for i in range(0,len(data)):
try:
if int(data[i][-2:])+1!= int(data[i+1][-2:]):
a.append(data[i])
else:
b.append(data[i])
except:
print(" out of index ")
tried to find solution but the given solutions like Identify groups of continuous numbers in a list
it's for integers in list and not strings + integers
Thank you in advance :)