Write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs the smalle
st and largest integers in the list.
Ex: If the input is:
10
5
3
21
2
-6
the output is:
2 and 21
1 answer:
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
You might be interested in
<span>The c++ operator delete is used to destroy dynamic variables.</span>
Factory reset or install a new OS without keeping the data.
Answer:
what are the followin six terms
Explanation:
Bottleneck i think is the word youre looking for, give me the options and ill tell you
An swer:
E. xpl an ation: