SyntaxFix
Write A Post
Hire A Developer
Questions
consider a dict
d = {'a': 3, 'b': 2, 'c': 3, 'd': 4, 'e': 5} from itertools import islice n = 3 list(islice(d.items(),n))
islice will do the trick :) hope it helps !