(Sep-16-2019, 07:20 PM)mafr97 Wrote: We are asked to create a function that will take in a dictionary and return the list in ascending order, either alphabetically or numerically.
What does mean 'return list in ascending order'? List of keys? List of values? List of key-value pairs?
One don't need complicated conversions, dictionary keys can be sorted just like
sorted(d)
, if values needed to be sorted then sorted(d.values())
and to sort list of key-value tuples sorted(d.items())
. Sorted function always returns list.
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.