get n items from dictionary python

Solutions on MaxInterview for get n items from dictionary python by the best coders in the world

showing results for - "get n items from dictionary python"
Emanuele
24 Jan 2021
1list(islice(d.iteritems(), n))
2'Update for Python 3.6
3list(islice(d.items(), n))