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

What is a creation myth , how can it reveal the values
What holds one strand of DNA together?
To what does crimson blotches refer? a Wars are always fought for the right reasons. b Battles are thrilling, exciting events. c War represents bloodshed and
Why was popular sovereignty so well-supported as a just and fair way to settle the slavery question?
How many solution does the system contain
AN Jamal has 10 sets of collectible coins. Each set has 5 coins. How many collectible coins does Jamal have? 5 10 50 100
Subordination indicates when one element in a sentence is less important than another. True False
what is the f(x)=(x-2)(x-4)​
please help me!!!!!!!!!!!
Christine is riding her bicycle. She rides for 11.2 kilometers at a speed of 7 kilometers per hour. For how many hours does she ride?