20th Oct 2020, 1:31 PM
zeeshan
zeeshan - avatar
3 Answers
+ 2
Cheque your spelling mistakes and mathematical symbols along with indentation gaps
20th Oct 2020, 1:34 PM
Ayush Kumar
Ayush Kumar - avatar
+ 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)
20th Oct 2020, 1:35 PM
Abhay
Abhay - avatar