If I have:
d = {\'one\':1, \'two\':2, \'three\':3, \'four\':4}
How can I get values of \'one\' and \'three\' in one command. Something like thi
Using list comprehension:
>>> d = {'one':1, 'two':2, 'three':3, 'four':4} >>> [d[key] for key in 'one', 'three'] [1, 3]