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
Vladimir [108]
2 years ago
6

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 11 22 33 ... 4949 50*50 with total. Use no variables other than k and total.
Computers and Technology
1 answer:
Tems11 [23]2 years ago
3 0

Answer:

total = 0

k = 1

while k <= 50:

total += k**2

k += 1

print(total)

Explanation:

Note: There some errors in the question. The correct complete question is therefore provided before answering the question as follows:

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 associates 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.

The answer is now explained as follows:

# Initialize k which is the number of term

k = 1

# Initialize total which is the sum of squares

total = 0

# Loop as long as k is less than or equal to 50.

while (k <= 50):

# Add the square of k to total in order to increase it

total = total + k * k

# Increase the value of k by one.

k += 1

# Finally, output total

print (total)

You might be interested in
Read the sentence and answer the question. "Adam Cooper, a cultural strategy officer for the mayor of London, agrees. He thinks
siniylev [52]
<span>I think its pioneers!</span>
8 0
3 years ago
Change the shape fill color to Dark Red. It is the first option in the Standard Colors section of the color palette.
maxonik [38]
Is this a question ?
3 0
3 years ago
Write a program that outputs "Hello World!" For ALL labs, end with newline (unless otherwise stated).
Vesnalui [34]

The program that output "Hello World " is represented as follows:

print("Hello World")

<h3 /><h3>Code explanation:</h3>

The code is written in python.

We use the print statement to print out the string word "Hello world".

When the code is run, the output of the code will be "Hello world".

"Hello world" is a string.

learn more on python code here: brainly.com/question/21497685?referrer=searchResults

8 0
2 years ago
This may vary in your state, but S/P2 recommends keeping all environmental documentation a minimum of:
Anettt [7]

A would be the answer!!!...

4 0
3 years ago
Read 2 more answers
A document can contain either footnotes or endnotes but not both.<br> True<br> False
serg [7]
This is false. They can contain both.
6 0
3 years ago
Other questions:
  • Vpns create a _____________ to transport information through public communications media.
    8·1 answer
  • ________ computers are specially designed computer chips that reside inside other devices, such as a car. Select one: A. Tablet
    11·2 answers
  • Which is a real-world example of a procedure?
    11·1 answer
  • Indicate if the following statements are True or False. Statement Circle one Internet Service Providers (ISPs) are proprietary n
    13·1 answer
  • To say the internet has helped democratize knowledge means that
    11·1 answer
  • What is meant by algorithm?​
    12·1 answer
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • Which items may interfere with a wireless connection and may cause disruptions or delays in submitting assignments in blackboard
    9·2 answers
  • FOR DIGITAL DESIGN/ PHOTOGRAPHY
    5·2 answers
  • What statement is accurate in regards to
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!