I'm trying to create a function where it returns a list of all values in the dictionary that are also keys. However I keep getting 'TypeError: argument of type 'int' is not iterable' printed in the Terminal. Why is this code not working?
def values_that_are_keys(my_dictionary):
for element, numbers in my_dictionary.items():
if numbers in element:
print(numbers)
values_that_are_keys({1:100, 2:1, 3:4, 4:10})
elementis an integer. You can't check if something is in an integer.