What am I doing wrong for 14/18 (Try It!)?


#1

I don't know what I'm doing wrong... I'm pretty sure I've followed the instructions.
This is my code.

squares = [x**2 for x in range(1, 11)]
filter(lambda x: x >= 30 and x <= 70, squares)

What have I done wrong????


#2

Your code is correct, but you were supposed to print the result.

print filter(lambda x: x >= 30 and x <= 70, squares)

#3

Thank you! That was really helpful. I can't believe I forgot to add that...


#4

You're very welcome :smile:


#5
squares = [x**2 for x in range(1, 11)]
print filter(lambda x: x in range(30,71), squares)

#6

This worked for me..

squares = [x**2 for x in range(1,11)]
print filter(lambda x: 30 < x < 70, squares)

#7

Perfect. On to 15!
and here's some more characters to meet the character limit.