Quick actions

cmd+k|ctrl+k

Navigation

Languages

Dictionary Comprehensions

Snippet info

Language

Python

Visibility

public

Author

alokhegde

Created

2020-10-06T11:06:55Z

Updated

2020-10-06T11:11:44Z

simple_dict = {
    'a':1,
    'b':2
}
my_dict = {key:value**2 for key,value in simple_dict.items() if value%2 == 0}

print(my_dict)
INFO