refactored sum_of_powers, Resolves #354

This commit is contained in:
guru kiran
2020-10-11 17:54:06 +05:30
committed by GitHub
parent 7df78ad5ed
commit e9db92ee22

View File

@ -11,7 +11,7 @@ Returns the sum of the powers of all the numbers from `start` to `end` (both inc
```py
def sum_of_powers(end, power = 2, start = 1):
return sum([(start + i) ** power for i in range(0, end + 1 - start)])
return sum([(i) ** power for i in range(start, end + 1)])
```
```py