Now You Try!


#1

what's wrong with this
cubes_by_four = [x * 2 for x in range(5) if x < 6]
even_squares = [x ** 2 for x in range(1,11) if (x ** 2) % 2 == 0]

print even_squares


#2

Nothing at all, unless you want it to behave differently in some way. Do you? If so, in what way?

What result are you getting? Which result were you expecting? Can you compute the result manually? If so, by studying your result vs the expected result, perhaps you can even tell what needs changing.