[英] How to find the largest number(s) in a list of elements, possibly non-unique?
这是我的节目,
item_no = []
max_no = 0
for i in range(5):
input_no = int(input("Enter an item number: "))
item_no.append(input_no)
for no in item_no:
if no > max_no:
max_no = no
high = item_no.index(max_no)
print (item_no[high])
输入示例:[5, 6, 7, 8, 8]
示例输出:8
如何更改程序以输出数组中相同的最高数字?
预期输出:[8, 8]