Now you try


Hi, please help me to understand whats wrong with this code.

cubes_by_four = [x**3 for x in range(1, 10) if (x**3) % 4 == 0]

Looks ok but I get this error "Looks like cubes_by_four is the wrong length. It should have 5 values."


Hello @systemblaster74501,

Codecademy wants you to include zero cubed in the list as well.
Try to iterate starting from zero.


I tired, in this case it will say that my list should start from 8 :slight_smile:

"It looks like your list has the wrong value at index 0. It should be 8. "


Then try iterating from 2 to 11 (not inclusive) using range(2, 11)


Now it works. Thanks.


yeah, I had the same problem, thanks so much for the help!:hamburger:


It works if you use (1,11) as a range, that way you make sure you cover 10.


cubes_by_four = [(x**3) for x in range(1,11) if (x**3) % 4 == 0]
print cubes_by_four
It will work