Python Advanced topics in python


#1

Hello ,Can anybody point my mistake in https://www.codecademy.com/en/courses/python-beginner-en-KAgt5/3/3?curriculum_id=4f89dab3d788890003000096#
following is my code:

squares=[x**2 for x in range(1,11)]

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

I get following error mesage

Oops, try again. It looks like you didn't print the correctly filtered list to the console
.


#2

your condition is not right:

x>=30 or x<=70

any value greater then 30 (30 till infinity) or lesser then 70 (infinity negative values till 70), in other words, this condition is true for every existing value


#3

How do I solve such challenge,I have never confronted with such logical conundrum. I have used the "or" operator in some previous challenges to set limit in two values?


#4

yes, but this time you want the value to be greater then 30 and smaller then 70 (inclusive)


#5

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