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 controls a computer's basic operations?
S_A_V [24]
 Basic Computer Operations. Input: Information and programs are entered into the computer through Input devices such as the keyboard, disks, or through other computers via network connections or modems connected to the Internet. The input device also retrieves information off disks.
3 0
3 years ago
1. How does the computer take data and information ?​
aniked [119]

Answer:

Data processing, Manipulation of data by a computer. It includes the conversion of raw data to machine-readable form, flow of data through the CPU and memory to output devices, and formatting or transformation of output. Any use of computers to perform defined operations on data can be included under data processing.  Input devices accept data in a form that the computer can use; they then send the data to the processing unit. The processor, more formally known as the central processing unit (CPU), has the electronic circuitry that manipulates input data into the information people want.

Explanation:

6 0
2 years ago
Complete the program below that takes in one positive, odd, integer, n (at least 3), and prints a "diamond" shape of stars with
avanturin [10]

Answer:

n = int(input("Enter the n (positive odd integer): "))

for i in range(1, n+1, 2):

   print(i*"*")

for i in range(n-2, 0, -2):

   print(i*"*")

Explanation:

*The code is in Python.

Ask the user to enter the n

Create a for loop that iterates from 1 to n, incrementing by 2 in each iteration. Print the corresponding number of asterisks in each iteration

Create another for loop that iterates from n-2 to 1, decrementing by 2 in each iteration. Print the corresponding number of asterisks in each iteration

5 0
3 years ago
PLEASE HELP ME!!!!!! ITS FOR 100 POINTS AND BRAINLIEST!!!!!!!! NO ONE EVER WANTS TO ANSWER MY QUESTION!!! I JUST NEED SOMEONE TO
KonstantinChe [14]

Answer:

be creative

Explanation:

being creative helps you and our time brainstorm some good ideas that will help you succeed and allow your team mates to have a voice too if you follow these you will be a good team leader

i dont know if  if this the answer that your looking for but i hope it help

7 0
2 years ago
Read 2 more answers
Psychologists studying infant memory want to determine at what age babies can remember specific events. An experimenter uses sev
vodka [1.7K]

Answer:

the number of imitated actions

Explanation:

According to my research on different research terminology, I can say that based on the information provided within the question the dependent variable in this situation is the number of imitated actions. This is because the the age in which babies remember specific events depends completely on the amount of actions imitated by the children.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

5 0
3 years ago
Other questions:
  • The internet may best be compared to a
    12·2 answers
  • Draw the cache tables and the state of all bits within them. Suppose you have a 16 byte cache with 2 byte long cachelines that i
    6·1 answer
  • Professor Zak allows students to drop the four lowest scores on the ten 100 point quizzes she gives during the semester. Design
    13·1 answer
  • Xbrl taxonomy: is the document format used to produce web pages. is the final product (report. is a classification scheme. is a
    12·1 answer
  • A lottery ticket contains five unique numbers. A set of unique numbers does not contain repeated elements. The winning combinati
    10·1 answer
  • Give four characteristics of hard disk​
    8·1 answer
  • Let’s say you attach four images to accompany an important tweet that you’ve composed in the Hootsuite Compose Box. On Twitter,
    8·1 answer
  • Most wires are covered in rubber to insulate them and keep people safe from electricity and heat true of false
    11·1 answer
  • Please answer this question​
    8·1 answer
  • I need someone to help me like rnnnnn please
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!