Created
May 7, 2020 01:17
-
-
Save Jay-flow/45329844ec3b32b9dde3375a04f18854 to your computer and use it in GitHub Desktop.
example_code for python dictinary comprehension
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def example_code(list_of_product_data): | |
kinds = {} | |
for index, product in enumerate(list_of_product_data): | |
if product == 'specific_kind': | |
kinds[index] = product | |
return kinds |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment