hejsiwosoow hejsiwosoow
  • 24-06-2021
  • Computers and Technology
contestada

Write a program that accepts inputs, outputs them and exits correctly when - 1
is pressed

Respuesta :

sandlee09
sandlee09 sandlee09
  • 29-06-2021

Answer:

Explanation:

The following program is written in Python. It simply creates an endless loop that continously asks the user for an input. If the input is not -1 then it outputs the same input, otherwise it exists the program correctly. A test output can be seen in the attached image below.

while True:

   answer = input("Enter a value: ")  

   if answer != "-1":

       print(answer)

   else:

       break

Ver imagen sandlee09
Answer Link

Otras preguntas

Because slave owners had done their best to keep slaves illiterate, many believed that __________ was what african americans needed to advance in society.
How would you use the word interpersonal in a sentence
How could you apply gandhi's principles to your life?
Which of the following is an example of the principle of checks and balances? A. Presidents can veto an act of congress B. Member of Congress have the power to
Answer for 49 Points
What are radioactive emissions and how are most humans exposed to them?
What practice allowed China to feed its growing population?
for what value of x must ABCD be a parallelogram? asap please!!
What awards or recognitions did Kate Chopin receive during her lifetime? Why did she receive these awards/recognitions?
Which of these is not a property of all living organisms?. Organization, acquisition of materials and energy, care for thier offspring, reproduction, responding