List Comprehensive


#1

cube_number = [number ** 3 for number in range(1,11) if number % 4==0]
print(cube_number)

Expected Output:
[8, 64, 216, 512, 1000]

Actual Output:
[64, 512] :frowning: Any Solution With description?


#2

is the expected output what you expect? Or what the lesson expect?

well, the only numbers divisible by 4 in range 1 till 11 are 4 and 8, so that is the only time number ** 3 gets appended to list