I'm embarrassed because it's such a basic question, but I'm asking you because I need help in the self-study process.
Problem is
b Implement a function (filp) that generates data of the dictionary structure and stores it in the dictionary by switching keys and values. Call the function and execute it. For processing when the original data has the same value, the new dictionary stores the value as a list.
Execution Example)
flip({"Japchae": "Korean food", "Short rib soup": "Korean food", "Sushi": "Japanese food", "Black bean noodles": "Chinese food"})
{"Korean food": ["Japchae", "Galbitang", "Japanese food": ["Sushi", "Chinese food": ["Black Bean Noodles"]}
This is.
Always with or without duplication:
It'll work.
I think this explanation is enough, so I'm going to shorten it.
© 2024 OneMinuteCode. All rights reserved.