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 allow you to write alphas on a computer keyboard
lions [1.4K]

Answer:

"To create any of these Greek letters using the Alt codes, simply press the "Alt" key while simultaneously typing the listed number. For example, to create the Greek letter Alpha (α), press the "Alt" key and type 224 using the keypad at the right side of your keyboard." - GOOGLE

5 0
3 years ago
How do you know if someone read your message on messenger?
kherson [118]
It would say that the person read the message on the picture of the person. Example if you texted your friend at 7.00 and it said that the person read at 7.15. got it now?
3 0
3 years ago
A user saves a password on a website the user logs into from a desktop. Under which circumstances will the password be saved on
artcher [175]

Answer:

same encryption certificate

Explanation:

only logical xD

4 0
3 years ago
Horizontal lines should be avoided in photographs t/f
Temka [501]
I belived its true is the answer
3 0
3 years ago
What can Strings store
horsena [70]
A string is generally considered as a data type and is often implemented as an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. String may also denote more general arrays or other sequence (or list) data types and structures.
5 0
4 years ago
Read 2 more answers
Other questions:
  • What is the IEEE standard for the Wi-Fi Protected Access 2 (WPA2) security protocol?
    6·1 answer
  • I just started game development using unity, I’m trying to control my sphere moving on a flat surface using the W,A,S,D keys, if
    11·1 answer
  • A quick boot allows you to do what?
    7·2 answers
  • A(n) __________ item is a hardware or software item that is to be modified and revised throughout its life cycle.
    6·2 answers
  • 12) If the image's name is filename.gif, how can I make this image the background of my page?
    6·1 answer
  • Plz plz plz plz plz plz plz plz plz plz plz pl plz plz plz plz plz plz plz plz plz plz plz plz olz plz plz
    14·1 answer
  • What is a single-user computer?
    8·1 answer
  • Your network has four Hyper-V hosts, which are running three domain controllers and about 10 member servers. Three of the member
    10·1 answer
  • How does a programmer use digital waves to transfer sound?
    11·1 answer
  • An opening inside the system unit in which you can install additional equipment can be known as
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!