The following are links to additional questions that our community has asked about this exercise:
This list will contain other frequently asked questions that aren’t quite as popular as the ones above.
Currently there have not been enough questions asked and answered about this exercise to populate this FAQ section.
This FAQ is built and maintained by you, the Codecademy community – help yourself and other learners like you by contributing!
Not seeing your question? It may still have been asked before – try () in the top-right of this page. Still can’t find it? Ask it below by hitting the reply button below this post ().
How do you then, print it out in an order? Is it for example possible to print out the keys from left to right, just as they have been written into the dictionary?
So for example:
Without calling upon the Collections library for the OrderedDict class (Google this and bookmark it for later), we can sort the keys and and iterate over them to print out the dictionary in that order.
>>> d = {'g': ['hey'], 'j':['everyone'], 'y':['here']}
>>> d
{'j': ['everyone'], 'y': ['here'], 'g': ['hey']}
>>> for key in sorted(d):
print ("{}: {}".format(key, d[key]))
g: ['hey']
j: ['everyone']
y: ['here']
>>>