๐
comprehensions in dictionary
how to use comprehensions in dictionary
python
values = {x:x*2 for x in range(5)}print(values)
Output
{0 : 0, 1 : 2, 2 : 4, 3 : 6, 4 : 8}
how to use comprehensions in dictionary
values = {x:x*2 for x in range(5)}print(values)
{0 : 0, 1 : 2, 2 : 4, 3 : 6, 4 : 8}
