Python Advanced topics in python


Hello ,Can anybody point my mistake in
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


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


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?


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


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