Answer to Question #220985 in Python for Hari nadh babu

Question #220985

Sum of K powers


This Program name is Sum of K powers. Write a Python program to Sum of K powers, it has two test cases


The below link contains Sum of K powers question, explanation and test cases


https://drive.google.com/file/d/1Oq4KM7EiY-hpyfssYGYvIJ_qgPywpP55/view?usp=sharing


We need exact output when the code was run

1
Expert's answer
2021-08-05T17:51:03-0400
N=int(input())
K=int(input())
sum1=0
for i in range(1,N+1):
    sum1=sum1+(i**K)
print(sum1)

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS