Untitled

mail@pastecode.io avatar
unknown
python
2 years ago
391 B
3
Indexable
Never
data = [245, 82, 1, 95, 8271, 4, 9, 45]


new_list = []
print(len(data))

for _ in range(len(data)):
    maximum_value = data[0]
    maximum_value_idx = 0
    for idx, element in enumerate(data):
        #print(indeks, liczba)
        if maximum_value < element:
            maximum_value = element
            maximum_value_idx = idx

new_list.append(maximum_value)
print(maximum_value_idx)