Write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs the smallest and largest integers in the list.

Ex: If the input is:

10
5
3
21
2
-6
the output is:

2 and 21

Answers

Answer 1

n = 1

lst = []

while n > 0:

   lst.append(n := int(input()))

lst.pop(-1)

print(str(min(lst)) +" and "+str(max(lst)))

I wrote this code in python 3.8. I hope this helps


Related Questions

If you need to change the typeface of a document, which menu will you choose?

Answers

Format menu

Format menu is used to change typeface of a document

Amanda would like to add text to a slide in her presentation. Select all of the correct methods she can use to add text.
Select "Text" from the Insert menu.

Click in the Task pane and enter text.

Draw a text box, click in it, and enter text.

Click in a placeholder and enter text.

PLEASE help

Answers

Answer:

Draw a text box

Explanation:

Because if she draw it she can edit and write what she want

Other Questions
Whats the reciprocal for -4 b -2 = 9/b-2 Answer ? Which of these is a fact?A Wearing a jacket and tie in the heat is a bad idea.B People shouldn't have to wear shoes that could damage their feet.C It is important for people to look professional at work.D Nicola Thorp worked for a company that said women must wear high heels. In a shopping district with a variety of stores, 9 of the stores sell jewelry. The jewelry stores make up only 3% of the shopping district. How many stores are in the shopping district? what is the slope of y= -1/6x - 3/2 In what ways can information be slanted in a news report? List at least five ways. Is the following relation a function? which of the following statements are true about supporting details?a- they do not add to the point of the writing b- they can be either stated or impliedc- they are facts, statistics, and examples that support the main idea The thallus of a mold consists of long, branched, threadlike filaments of cells called _________ that form a tangled mass called a How did isolation affect culture in Oceania?A. Languages in Tasmania are unrelated to those off the island.B. Midway Island is a protected research station.C. The Philippines are predominantly Catholic.D. Christianity is practiced throughout New Zealand. Which scenario is likely to result in the most diverse offspring? Asexual reproduction by budding Asexual reproduction by binary fission Sexual reproduction between two individuals in the same population Sexual reproduction between two individuals from different continents What kind of figurative language do you see in this line from "Paul Revere's Ride"? Masses and moving shapes of shade.A. AlliterationB. AllusionC. PersonificationD. Onomatopoeia Which of the following statements is a misunderstanding that many middle- and upper-class people have about low-wage work? A. People applying for low-wage jobs usually have to take a drug test. B. Low-wage workers usually dont have healthcare benefits. C. Low-wage workers rarely get paid vacations. D. If low-wage employees work full-time, they wont be poor. E. Low-wage workers are entitled to equal opportunity employment. La Distribuidora Industrial Dulzura va a seleccionar entre dos compaas para transportar su azcar al mercado. La primera compaa cobra 49,430.00 por alquilar los camiones ms 2,480.50 adicionales por cada tonelada de azcar. La segunda compaa cobra 60,500.00 por alquilar los camiones ms 1,927.20 adicionales por cada tonelada de azcar. A scientist thinks he found a new metal, so he published a paper about this metal. About 1 week after the scientist published the paper, you noticed a problem with the paper the scientist wrote. You noticed that this metal was not a new metal. In fact, this metal was discovered years ago. You determined this when you saw the atomic emission spectrum. As you read the article, you remembered that each atomic emission spectrum is unique to each element and the atomic emission spectrum matched one that was already discovered. Using the techniques from Chemistry, you ran a Flame Test with a piece of the metal (the metal is safe to use) that you had shipped to you. You found the metal turned the flame yellow. What metal did you have in your possession?**ANSWER CHOICES***Barium *Calcium*Strontium*Copper*Sodium Define a rotation of the earth answer fast 91 pointThe elevator of a building can safely carry no more than 4000 lbs. A worker moves supplies in 50-Ibs boxes from the loading dock to thefourth floor of the building. The worker weighs 210 lbs. The cart weighs 95 lbs. What is the greatest number of boxes he can move in onetrip?1Write an inequality and solve.2b choose your answer...Vtype your answer...34NextPrevious5678 An object is moving across a surface, but it does not gain or lose speed. Which best describes the objects force? Bill built a rectangular pen in his yard that measures feet by 6 feet. He wants to make another pen that is similar but not congruent to the one he built. Which these rectangles is similar? PLEASE HELPPP IDEK WHEN WE LEARNED THISSS