Comprehension now you try!


whats wrong in this code?

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


The forum is for if you are properly stuck, how much time is there between starting an exercise and going to the forum?


ok i have got it, i will spend some more time over it


it just takes a lot of time to help everyone and keep high quality. Don't forgot that you can also search and read older topics, see if someone had a similair problem, which can help you and your understanding about the problem :slight_smile:


what does evenly divisible by 4 mean? does it mean on deviding the cube by 4 we should get the quotent as an even number?


it means that you need to check if x is divisible by 4, if so append the cube of x to your list


thanx and yes i will keep that in my mind before i ask any question i will check previous ones.
and thankyou so much for your help and sory for the inconvinience!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.