Wednesday, February 20, 2019

Q:16 Get the expected output from the given dictionary

Input = [
{"subject" : "Hello", "message": "World"},
{"subject" : "Hello", "message": "Stranger!"},
{"subject" : "Hello", "message": "Stranger!"},
{"subject" : "Welcome", "message": "Python"}
]

Output:
{'Hello': ['World', 'Stranger!', 'Stranger!'], 'Welcome': ['Python']}