Write a function named "print_keys" that takes a key-value store as a parameter with strings as keys and integers as values. The function prints each key of the input on a separate line. That is, it prints all keys of the key-value store separated by new line characters
I've been stuck for a while on this problem and cant seem to get it. Ive tried making a for loop and concatenating with that but it isnt working how i expected it. Really need help with this, thanks.
this is what i have so far
def print_keys(dict):
for key, value in sorted(dict.items()):
print('{} - {}, {} - {}'.format(key, value[0], key, value[1]))
this is the error that shows error on input [{'spy': 9, 'stimulate': 8, 'strict': 8}]: 'int' object is not subscriptable
note the problem already has a list generated in their all i have to do is what the question is asking