1
0

Switch range(len(list)) to enumerate(list)

This commit is contained in:
Akbar Rahman 2018-07-11 19:45:51 +01:00
parent 6d2e8e7030
commit e62257daaa
Signed by: alvierahman90
GPG Key ID: 20609519444A1269

4
bot.py
View File

@ -145,8 +145,8 @@ def ls_tasks(arguments, chat_id):
tasks = get_tasks(chat_id)
counter = 0
for i in range(len(tasks)):
tasks[i] = (counter, tasks[i])
for i, value in enumerate(tasks, start=0):
tasks[i] = (counter, value)
counter += 1
tasks = sorted(tasks, key=lambda tup: tup[1].priority)