it fixes the issue 1. first error: "TypeError: 'generator' object is not callable"

this error raise because you pass to filter build-in method a generator, you "cover" the lambda method with parentheses:

code :

```
filter((lambda n: n%y != 0 for y in range(2,n)), range(2,n+1))
```

```
filter(lambda n: n%y != 0 for y in range(2,n), range(2,n+1))
```

```
lambda n: n%y != 0 for y in range(2,n)
```

```
lambda n: all(n%y != 0 for y in range(2,n))
```

```
sum=0
```

```
n_prime_sum = 0
```

```
n = int(input())
n_prime_sum = 0
n_prime_sum = sum(list(filter(lambda n: all(n%y != 0 for y in range(2,n)), range(2,n+1))))
n_prime_sum
# n = 10
```

```
17
```

```
# original code by David Eppstein, UC Irvine, 28 Feb 2002
# with comments by Eli Bendersky, https://stackoverflow.com/a/568618
def gen_primes(n):
"""Much more efficient prime generation, the Sieve of Eratosthenes"""
D = {}
q = 2 # The running integer that's checked for primeness
while q <= n:
if q not in D:
# q is a new prime.
# Yield it and mark its first multiple that isn't
# already marked in previous iterations
#
yield q
D[q * q] = [q]
else:
# q is composite. D[q] is the list of primes that
# divide it. Since we've reached q, we no longer
# need it in the map, but we'll mark the next
# multiples of its witnesses to prepare for larger
# numbers
for p in D[q]:
D.setdefault(p + q, []).append(p)
del D[q]
q += 1
n = int(input())
n_prime_sum = sum(gen_primes(n))
print(n_prime_sum)
# n = 10
```

```
17
```