Answer to Question #238695 in Python for Dillon

Question #238695

Given that n refers to a positive int use a while loop to compute the sum of the cubes of the first n counting numbers, and associate this value with total. Use no <span style="text-decoration-line: none;">variables</span> other than n, k, and total.



1
Expert's answer
2021-09-17T20:58:11-0400
n = int(input('Enter positive integer here: '))
n1 = 0
i = 1
while i <= n:
    n1 = n1 + i ** 3
    i = i + 1
print(n1)

Enter positive integer here: 6
441

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