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

A swim team ordered 36 jackets that each cost the same amount. The total cost of the order was $1,116. Let c be the cost of each jacket. How much did each jacke
A bike with an original price of 90$ is discounted 40%. What is he sale price
PLEASE HELP ASAP! These two triangles are similar. Solve for X.
the potential energy of a body if its mass is 30 kg and height 30 m and gravity 10m/sec2​
In terms of product differentiation, how many benefits should a company aggressively promote to the target market?.
How do i do this problem.
how do i solve b^2-5b+3
__________ is a psychological bias that applies to students who do not spend sufficient time studying.
The price of an item has risen to $81 today. Yesterday it was $60. Find the percentage increase
What is the value of 3^2/3^4?