I have 2 lists dependent on each other like a person and where is he/she from. I want to make groups based on where they are from.
People = ["A","B","C","D","E","F"]
City = ["Bombay","Delhi","Pune","Pune","Bombay","Pune"]
Here, A is from Bombay, B is from Delhi, and like that. I want to group all people from Bombay in one group, Delhi in one group, and Pune in one group. Then I want to assign some task to each group, like people from Bombay will do task X, people from Delhi will do task Y, and people from Pune will do task Z. How can I do that in python?
A group is like a list. Example:
Bombay = ["A","E"]
Delhi = ["B"]
Pune = ["C","D","F"]