Python 3. Define a function called sorted_by_keys that takes a dictionary as input and returns a list of its values, sorted in alphabetic order based on the keys that have those values
def sorted_by_keys(d):
lst = list(sorted(d.items()))
values = []
for k, v in lst:
values.append(v)
return values
# Testing the function here. ignore/remove the code below if not required
dictionary = {
"this": 9,
"is": 2,
"great": 4
}
print(sorted_by_keys(dictionary))
Python 3. Define a function called sorted_by_keys that takes a dictionary as input and returns a...