1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
mart [117]
3 years ago
13

Use the variables k and total to write a while loop that computes the sum of the squares of the first 50 counting numbers, and a

ssociates that value with total. Thus your code should associate 1*1 2*2 3*3 ... 49*49 50*50 with total. Use no variables other than k and total.
Computers and Technology
1 answer:
Vikentia [17]3 years ago
6 0

Answer:

total=0

def calcsumnumsquare(k,total):

   while k>=1:

       total+=int(k)*int(k)

       k-=1

   return total

print(calcsumnumsquare(4,0))

Explanation:

The program required is written above. It uses only two variables k and total as mentioned in the question. And the total is initially set to 9, and then its value is incremented by the square of each k during each loop established by while loop. And finally, when k=1, the output is returned. And we have printed the return value using print.

You might be interested in
What is the advertising photographer’s main objective in creating an image?
iren2701 [21]
B. To sell it as a product
8 0
3 years ago
You must establish credit in order to buy a house true or false
iren2701 [21]

verry true, unless ou dont need a loan, if you have cash then the answer is false

8 0
3 years ago
A database stores a large amount data in vertical ___
myrzilka [38]

Records for the first one and table for the second one

4 0
3 years ago
which of the following is not an e-reader you would use as a alternative to carrying around a set of textbooks?
musickatia [10]

I have a kindle paper white that I downloaded all of my avalible textbook onto if that helps I find it much better then carrying around a bunch of textbooks
4 0
3 years ago
Generally, information is extracted from __ for communication.
denis-greek [22]
Extracting information from the message.  It i<span>s exclusive to the "interpreting the message" step in a business communication process.</span>
7 0
3 years ago
Other questions:
  • When a typist changes from a conventional typewriter to a word processor, his typing schema will have to _____ to incorporate th
    12·1 answer
  • The Sumif formula will add numbers together from a range of numbers ONLY IF they contain the criteria. True or false
    8·1 answer
  • Your health insurance company gives you a discount if you wear a fitness-tracking bracelet. After wearing it for a few months, y
    5·1 answer
  • Sonora wants to extend the cells to be added in her formula. what is the quickest way to add more sells?
    10·2 answers
  • What part of the code is a signal for the function to execute and pass back a value?
    11·2 answers
  • The accounting department moved its network-attached printer from one side of the office to a more centralized location, making
    11·1 answer
  • Some commands listed in a menu cannot be selected.<br><br><br> True or False
    13·2 answers
  • Typing which capitals and exclamation points in an email is an example of
    14·1 answer
  • Regardless of if you use social media or not, would you rather be conservative rather than outgoing on social media? Why or Why
    13·1 answer
  • Help brainliest True or False
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!