Skip to content

Instantly share code, notes, and snippets.

@codecademydev
Created February 2, 2021 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codecademydev/b8803ce3f8a7bd5bc352e24023660092 to your computer and use it in GitHub Desktop.
Save codecademydev/b8803ce3f8a7bd5bc352e24023660092 to your computer and use it in GitHub Desktop.
Codecademy export
# Write your values_that_are_keys function here:
def values_that_are_keys(my_dictionary):
my_dictionary_smells_funny = []
for value in my_dictionary.values():
if value in my_dictionary.keys():
my_dictionary_booty.append(value)
return my_dictionary_smells_funny
# Uncomment these function calls to test your function:
print(values_that_are_keys({1:100, 2:1, 3:4, 4:10}))
# should print [1, 4]
print(values_that_are_keys({"a":"apple", "b":"a", "c":100}))
# should print ["a"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment