I have a list with the keys:
mykeys=["a", "b"]
mydictionary = { "a": 1, "b": 3, "c": 6}
I want to print out the key, value pair from my keys. Example output:
result = {"a": 1, "b": 3 }
When I use list comprehension I can only get the values:
[mydictionary[x] for x in mykeys]