# Comprehending comprehensions

#1

<Below this line, add a link to the EXACT exercise that you are stuck at.>

<In what way does your code behave incorrectly? Include ALL error messages.>

<What do you expect to happen instead?>

```python Hi folks Do you know what is wrong with the code below?

m=[x for x in range(1,16)]
threes_and_fives=filter(lambda x:if x%3==0 or x%5==0,m)

<do not remove the three backticks above>

#2

in this exercise , i think no need for filter and lambda ; create a list, threes_and_fives, that consists only of the numbers between 1 and 15 (inclusive) that are evenly divisible by 3 or 5.

#3

Yes,I did it as you say and was correct. but I want to know that what is the problem with this way?

#4

in lambda syntax no need for if , just write condition

#5

the code is tested against a certain test. Good solutions may fail to pass the test
this expression
threes_and_fives = [x for x in range(1,16) if (x % 3 == 0) or (x % 5 == 0)]
is one line of code, single function and provides the expected result,

using a “lambda filter” on a “list comprehension” provides the same result but do non pass the testing formula