Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
ids = [('681581215',), ('581082656',), ('1659779061',)]
for i in ids:
tb.send_message(i[0], message)
ids = [('681581215',), ('581082656',), ('1659779061',)]
# Проверяем кортеж на длину, чтобы избежать IndexError
# Пакуем в сет, чтобы избежать дубликатов
ids_for_send = {idt[0] for idt in ids if len(id_) > 0}
for idx in ids_for_send:
tb.send_message(idx, message)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question