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

Which poetry element affects the poem's sound? A. Subject B. Rhythm C. Type D. Theme
Rukmani shows that she is able to both appreciate traditional ways and take advantage of modern ideas when she ____. A. chooses to sell produce to both Old Gran
What is the definition of aquatint?
which describes Abraham Lincoln`s belief about the meaning of the Civil War
The area of a sector of a circle with a radius of 4 centimeters is 2.512 square centimeters. The estimated value of π is 3.14. The measure of the angle defini
Which is a factored form of 8x^3+1?
One cubic foot of sand weighs 100 pounds a square sandbox with 5 foot sides has half a foot of sand in it how many pounds of sand in the sandbox holding
Mozart was best known for which of the following?
Match these items. 1 . pituitary gland chemical supervisor of body 2 . secrete
complete the comparison 26 < a. 54 b.13 c.25 d.26