from itertools import dropwhile
a = [5, 11, 25]
n = 8
a1 = [0]+a+[31]
a2 = [(item+1, a1[idx+1]-item-1) for idx, item in enumerate(a1[:-1])]
a3 = list(dropwhile(lambda x: x[1]<n, a2))
for item in range(a3[0][0], a3[0][0]+n):
print(item)
Traceback (most recent call last):
File "D:\PSAutoRecover\denyshaiduk_hillel\bookticket\tickets.py", line 169, in <module>
get_certain_number_tickets(ROUTES, tickets)
File "D:\PSAutoRecover\denyshaiduk_hillel\bookticket\tickets.py", line 107, in get_certain_number_tickets
ticket_emunerate = [(ticket.place + 1, tickets[ticket.place + 1] - ticket.place - 1)]
~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
TypeError: unsupported operand type(s) for -: 'Ticket' and 'int'