Here is my program,
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])
Example input: [5, 6, 7, 8, 8]
Example output: 8
How can I change my program to output the same highest numbers in an array?
Expected output: [8, 8]
i
both for indicesi in range(5)
then also for items/values:for i in item_no
. Better to dofor no in item_no