Skip to content

Instantly share code, notes, and snippets.

@fatosmorina
Created August 22, 2021 07:06
Show Gist options
  • Save fatosmorina/bdd2cffae3d528bdd734e0f9710e9140 to your computer and use it in GitHub Desktop.
Save fatosmorina/bdd2cffae3d528bdd734e0f9710e9140 to your computer and use it in GitHub Desktop.
odd_valued_keys = [key for (key, value) in dictionary.items() if value % 2 == 1]
print(odd_valued_keys) # ['first_element', 'third_element']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment