Consider the following dictionary, d:
d = {\'a\': 3, \'b\': 2, \'c\': 3, \'d\': 4, \'e\': 5}
I want to return the first N key:value pairs f
Did not see it on here. Will not be ordered but the simplest syntactically if you need to just take some elements from a dictionary.
n = 2 {key:value for key,value in d.items()[0:n]}