If n is a positive integer, what is the output of the following snippet of code?
```
P = [x for x in range(1, 2 * n) if x % 2 == 0]
print(sum(P))
```
Q9
24 Dec 2023
Programming in Python · Week 4
Q9.If n is a positive integer, what is the output of the following snippet of code?
```
P = [x for x in range(1, 2 * n) if x % 2 == 0]
print(sum(P))
```