Comprehension now you try!


#1

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


#2

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


#3

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


#4

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:


#5

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?


#6

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


#7

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!


#8

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