`X`

(upper case) in line 1, but you later refer to `x`

(lower case), which does not exist.The line

`Fact = Fact*1`

does not do anything useful.

I also suspect the last line of your code should be indented the same as the previous line.

See more:

Write A Python Program To Find The Sum Of The Series:- X - X**2/2! + X**3/3! - X**4/4! + X**5/5! - X**6/6!

**What I have tried:**

```
X = int(raw_input("Enter the value for x:"))
j = int(raw_input("Enter The value for j:"))
Sum = 0
Fact = 1
Sign = 1
for i in range(1,x+1):
for i in range(1,j+1):
Fact = Fact*1
Sum += (Sign*(X**i)/Fact*j
```

Comments

You declare

The line

does not do anything useful.

I also suspect the last line of your code should be indented the same as the previous line.

`X`

(upper case) in line 1, but you later refer to `x`

(lower case), which does not exist.The line

`Fact = Fact*1`

does not do anything useful.

I also suspect the last line of your code should be indented the same as the previous line.

```
for i in range(1,x+1):
for i in range(1,j+1):
```

Using

`i`

as the counter of 2 nested `for`

loops is an error too.`Sum += (Sign*(X**i)/Fact*j`

Here you gave 2

`(`

bit only 1 `)`

Advice: take a sheet of paper and write all what you need with 1 line per element in the sum and 1 column for each piece of element.

Then your program will need to prepare each pieces and then update the sum.

Don't mind using comments in code.

v2

Comments

Thank You For The Suggestion

Hope it helped.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject,
503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada
+1 416-849-8900 x 100

Improve questionto update your question.j = int(raw_input("Enter The value for j:"))

Sum = 0

Fact = 1

Sign = 1

for i in range(1,x+1):

for i in range(1,j+1):

Fact = Fact*1

Sum += (Sign*(X**i)/Fact*j

here a red line appears saying there is syntax error

Improve questionto update your question.Comments can't display indentations.