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

The length of a rectangle is 7 inches and the width is (x+2) inches. Write an expression in simplest form that represents the area of a rectangle.
which is not a major component of natural gas
You found $6.60 on the ground at school, all in nickels, dimes, and quarters. you have twice as many quarters as dimes and 42 coins in all. howmany of each type
a strategic crossroads northeast of richmond
Why are the terms underfat and overfat useful?
Simplify (0.6x^4)(0.2x^6)
Social psychology is a subfield of psychology that studies all of the following except how __________. a. cultural influences affect behavior b. health habits
True or false: capitalism is a competitive economic system in which private citizens own the factors of production
In most instances, you should move a patient on a wheeled ambulance stretcher by
Does the order of variables matter when combining like terms in algebra