0
What is wrong with this code
3 Answers
+ 2
Cheque your spelling mistakes and mathematical symbols along with indentation gaps
+ 1
I corrected some very basic mistakes like using \ instead / ,wrong indentation ,and rangw instead of range but there are many more that you will be able to solve yourself ,I hope so
x = int(input("Enter number: "))
n = int(input("Enter a power: "))
s = x
for a in range(2,n+1):
f = 1
for i in range(1,a+1):
f *= i
term = ((x**a) * sign)/f
s += term
sign *= -1
print("sum of first",n,"term: ",s)



