In python

Write an expression that executes the loop body as long as the user enters a non-negative number.

Note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds and report "Program end never reached." The system doesn't print the test case that caused the reported message.

Sample outputs with inputs: 9 5 2 -1
Body
Body
Body
Done.

Answers

Answer 1

Answer:

inputed = input("Choose some numbers, each separated with a space: ")

chosen = list(inputed)

chosen = chosen.remove(' ')

for value in chosen:

if '-' not in value:

print(Body)

else:

print(Done)

break

Explanation:

The for loop will go through every value in the list (your numbers) and check if it is positive or negative.


Related Questions

does advanced auto parts install engine air filter

Answers

Answer:

You have to do it yourself.

Explanation:

Other Questions
How to find the square root of complex numbers?? Find the square root of (6+8i) ?? Give a one-line description of the constitution.Please!: ) What does appropriation have in common with street art?HELP MEEEEEEEEEEEEEEE what is the solution of the system of equations 4x+2y=-1 and 3x+4y=3 The researcher had to throw out some surveys because theparticipants didn't complete them in full. What happenedto the power? Why? The measures of heights (in inches) of a class of students are shown. 60, 60,54, 62, 62, 57,58, 65, 54,67, 63,57, 62, 54, 72, 66, 54, 69, 55, 61 Find the mean, median, mode, range, and standard deviation of the heights.b. A new student who is 7 feet tall joins your class. How would you expect this students height to affect the measures in part (a)? How and why did the USA win World War 2 Pretend that you are the administrative assistant for the marketing department of ABC Technologies. You are coordinating travel for an upcoming meeting in another state. You need to ask the director of the Marketing Department who is going to the meeting, the dates they will be gone, and how many rental cars and hotel rooms they will need. Write an e-mail to the director asking for this information. Be sure to include the elements of an e-mailthe sender, recipient, date, subject, and message. (Make up the names and any other information, as needed.) The day before the drawing of a $600 million Powerball letter, you notice that a line of people waiting to buy their Powerball tickets is stretched outside the door of a nearby convenience store. Based on what you've learned, provide some perspective on why these people are doing this, and what would likely happen if you or one of these individuals happened to pick the right numbers. How would winning the Powerball alleviate stress and change a persons lifestyle? How do you believe it could create stress for a person? Evaluate the degree to which Third World countries were successful in their quest to end colonialism and establish new ways of serving their populations. Teachers are being trained to standardize the scores they give students essays. The results are shown in the tablesCalculate the MADs for the teachers scores. Did the teachers make progress in standardizing their scores?____,(Yes or No) The MAD before the training was ______(MAD for the top chart) and the MAD at the end of the training is _______,(MAD for bottom chart) so _______ (progress or no progress)was made toward standardizing test scores In the process of . DNA is used as a template for making another type of Nucleic acid? what is the cap of ia? my history question How the circulatory and respiratory systems work together to deliver oxygen to the bodys tissues Frank grows evergreen trees. He grew 535 trees forthe holiday season. In November he sold 215 treesand in December he sold 275.a. Write an expression. Then solve.b. Frank replanted the left over trees with theaddition of 650 more trees. How many trees willhe have for next season? please help I will give brainlyist to the first answer!!!How do taxes benefit children, families, and communitys? Whats 36 km=?m into a desmal If a given set of cash flows is expressed in nominal terms and discounted at the nominal rate, the resulting present value will be the same as if the cash flows were expressed in real terms and discounted at the ____ rate. Sandra bought 4 pounds of sweet potatoes for $5.36. What is the cost per pound of the sweet potatoes? A. $0.75 B. $1.34 C. $1.26 D. $9.36 3. In the formula F = kx , what does the minus sign indicate?It indicates that the restoring force is in the direction of the displacement.It indicates that the restoring force is in the direction opposite the displacement.It indicates that mechanical energy in the system decreases when a system undergoes oscillation.None of the abovePlease show all of your work.