Now you try


#1

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."


#2

Hello @systemblaster74501,

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


#3

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. "


#4

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


#5

Now it works. Thanks.


#6

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


#7

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


#8

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