i have a list
a1 = ['1', '5-10', '12', '18', '23', '100-110', '16-17', '20']
i want this list of elements in increasing order like
a1 = ['1','5-10','12','16-17','18','20','23','100-110']
please anyone help me to arrange this
case = ['1', '5-10', '12', '18', '23', '100-110', '16-17', '20']
case1 = [i.split('-', 1)[0] for i in case]
case1 = [int(x) for x in case1]
case1.sort()
after print the case1 output is
[1, 5, 12, 16, 18, 20, 23 ,100]
but i want the output is like
[1, 5-10, 12, 16-17, 18, 20, 23, 100-110]