Use comprehension to make the following dictionary: 0: 0, 1: 1, 2: 8, 3: 27, 4: 64, 5 125, 6: 216, 7: 343, 8: 512, 9 729 Show transcribed image text Use comprehension to make the following dictionary: 0: 0, 1: 1, 2: 8, 3: 27, 4: 64, 5 125, 6: 216, 7: 343, 8: 512, 9 729
Solution
d = {x:x**3 for x in range(10)}print(d)
{0: 0,
OR
OR