jm112893 jm112893
  • 10-02-2024
  • Computers and Technology
contestada

I am not sure what I am doing wrong in this python code. My code works fro the first inputs but does not produce an output with any other values.

I am not sure what I am doing wrong in this python code My code works fro the first inputs but does not produce an output with any other values class=

Respuesta :

sqdancefan
sqdancefan sqdancefan
  • 10-02-2024

Answer:

  straight-line code is executed exactly once

Explanation:

You want the reason your code does not produce more than one set of outputs.

Straight-line code

Your code reads two inputs, swaps them, outputs the swapped values, and stops. This will give the behavior you have described.

If you want it to repeat, you need to put the code in a loop. Usually, such a loop will have a terminating condition, such as a number of executions, or an input value signifying the end of input data.

Answer Link

Otras preguntas

what is 40% increase to $2,780?
How do you use savings and scarce in the same sentence
a government can be both a monarchy and an anarchy at the same time?
Evaluate 3 squared times 3 cubed
A right cylinder has a radius of 4 and a height of 11. What is its surface area?
Which of the following sentences contains a comma error? With the moving van packed, my friend had to say goodbye. The packages became too heavy for me, I dr
A hammer falls off the top roof and strikes the ground with a certain kinetic energy. If it fell from a roof twice as tall how would the kinetic energy compare?
rounded to the nearest thousand of 275,608
What is a primary source? a. a document made by someone who actually saw an event b. a photograph taken by a professional photographer c. a document created
Between which of the following two nations or territories does Baffin Bay form a natural boundary?