Dictionary Comprehensiond = {1:1, 2:8, 3:27}d1 = {}for i in range(1,11): d1[i] = i ** 3print(d1)d2 = {i:i ** 3 for i in range(1,11)}print(d2)
Post a Comment