Why does this code not work:

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

Also, please explain the syntax for the lambda (:

Why does this code not work:

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

Also, please explain the syntax for the lambda (:

You are supposed to print out the values in squares between 30 and 70, but you try to slice the list to print out the values with indexes between 30 and 70. Use <= to select the values from squares.

If you really wanted to print out the squares from index 30 to 70 you would also have to use `x in squares[30:70]`

, because the lambda selects all x that make the statement behind the colon true.

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

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

this is my answer.

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

I had to use another variable for x**2, because I can't just use (lambda x**2... : and if I don't use square, I get the results of x, not x**2. If there's a shorter way to do it, I'll be happy to learn.

despair186 - my code is below. You don't need to use x**2 (or a variable set to it) in the lambda part. I think the x**2 is just used to populate the list. If you imagine the numbers in the list as digits, rather than the calculation, it helps separate the two in your mind.

i believe your 'y=x**2' is just ignored by the rest of the code. You could use any name for the lambda variable be it x, y or anything else.

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

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

spacecamel100,

I came up with the exact same code on my own (surprisingly, maybe some of this is beginning to stick.) It worked flawlessly to my surprise.

Iām stuck. Iām using this code and it doesnāt work. I keep getting a āSCT Error.ā In addition, it seems like thereās no way to advance in lessons, which completely kills my experience. Can anyone help please?

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

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

same issue here. I keep getting the āSCT errorā, but its still printing the values in the list that its supposed to

same here, really frustrating.

Tried using another browser and deleting cookies. Nothing helps.

Hi,

i am also facing same issue and reported as bug, can you pls tell me how much time it will take to sort out

same here with this code:

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

(I use the āprintā just to check the results)

@coursemaster09509 did the matter resolve? I am also getting the same SCT error.

NEED HELP:

Below is the code that I use, but I always end up getting an SCT error.

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

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

Does anyone have have a solution that works?

It didnāt work yesterday (as Iāve written above) but just now it worked so if it was indeed a problem on their end, thank you guys for the bug reports and I hope it works for you too if you try again.