Advertisement

TrimwebsolutionsTrimwebsolutions

Problem and Solutions

Prioritizing tasks in python3 using dictionary and list in python ?

By M.K. Verma · 3 May 2022

Prioritizing tasks in python3 using dictionary and list in python ?

Try to start from this:

tasks_to_do_today = ["cleaning", "dishes", "vacuuming", "cooking"]
print(sorted(tasks_to_do_today, key=lambda x: labels_priority[x]))

Python removes duplicates in a dictionary, not in a list.