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
Which principle suggests that specific single responsibility interfaces are better than one general purpose interface?
ElenaW [278]

Answer:Interface segregation principle

Explanation: Interface-segregation principle (ISP) is amongst the major principles of the object-oriented design which describes that none of the users/clients can be forced for indulging and depending on the unknown methods or methods that they don't have knowledge about.

It functions by making the interfaces visible to the user that specifically fascinates them and keeping other smaller interfaces.Interfaces are made by splitting process and making the small interfaces from them.

8 0
3 years ago
Which MUD configuration is the most difficult to maintain
mihalych1998 [28]
This may be considered particularly appropriate since, due to the room-based nature of traditionalMUDs<span>, ranged combat is typically </span>difficult<span> to implement, resulting in </span>most MUDs<span> equipping characters mainly with close-combat weapons.</span>
6 0
3 years ago
Read 2 more answers
Who wants to be my tutor?
anzhelika [568]

Answer:

i would but im not big brain

Explanation:

8 0
3 years ago
Read 2 more answers
Which extension is appropriate for Word document templates?
expeople1 [14]
The answer to this question is A
8 0
2 years ago
Read 2 more answers
You step out of your office and miss a telephone call. when you sit at your desk you notice that the voicemail light is blinking
Sauron [17]
The answer is <span>Unified Communications.  </span><span>You step out of your office and miss a telephone call. when you sit at your desk you notice that the voicemail light is blinking on your phone, you have a new email, and you have a transcribed instant message on your computer screen in the form of an instant message. your organization has most likely adopted Unified Communications type of technology.  </span>
6 0
3 years ago
Other questions:
  • When a range of IP addresses is set aside for client devices, and one of these IPs is issued to these devices when they request
    14·1 answer
  • What career cluster does a fish and game warden fall in?
    14·1 answer
  • James, a technician, needs to format a new drive on a workstation. He will need to configure read attributes to specific local f
    5·1 answer
  • An array of integers named parkingTickets has been declared and initialized to the number of parking tickets given out by the ci
    14·1 answer
  • When an interrogator speaks highly about how a crime was committed, hoping to get the suspect to brag about his or her involveme
    7·2 answers
  • What is blogging
    15·2 answers
  • ...................is a high level, structured , open source programming language​
    10·1 answer
  • In fnaf who´s spring trap in fnaf 3 and who are the five victim names that he murdered and lure them into the back room.
    10·2 answers
  • Use the svd() function in matlab to compute a, the rank-1 approximation of a. clearly state what a, is, rounded to 4 decimal pla
    15·1 answer
  • a data analyst is working with a spreadsheet that has very long text strings. rather than counting the characters themselves to
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!