Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how do i make the code correct O of 3 points Question 1 Unlimited tries Given that n refers to a positive integer, use a
how do i make the code correct
O of 3 points Question 1 Unlimited tries Given that n refers to a positive integer, use a while loop to compute the sum of the cubes of the first n counting numbers, and assign this value to total. In other words, total should be assigned: 1 * 1 * 1 + 2 * 2 * 2 + ... ni nin Use no variables other than n, k, and total. 1 total=0 2 k=1 3 - while kun: total+=k***k 5 k+=1 n 4 HA 1 Logic errors. Review the test case table. Remarks and hints When executed, your code went into an infinite loop. Carefully check the condition in any loop you have written and carefully consider the body of the loop-- be sure that it will eventually make the loop condition falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started