# Accept integer number and store it to a list until user input is 0.
# Display the content of the list and size of the list.
# Display the highest and lowest numbers in the list and the index number it can be found.
number_lst = []
while True:
number = int(input())
if number == 0:
break
else:
number_lst.append(number)
print('The list:', number_lst)
print('Size of the list:', len(number_lst))
print('The highest number is {}, the index is {}'.
format(max(number_lst), number_lst.index(max(number_lst))))
print('The lowest number is {}, the index is {}'.
format(min(number_lst), number_lst.index(min(number_lst))))
Comments
Leave a comment