阅读以下程序,请问程序运行后,最后的输出结果是?
ls = [81, 58, 19, 29, 85]
for i in range(2):
max = 0
for j in range(i,len(ls)):
if ls[j] > max:
max = ls[j]
max_index = ls.index(max)
temp = ls[i]
ls[i] = max
ls[max_index] = temp
print(ls)
[81, 58, 19, 29, 85]
[85, 58, 19, 29, 81]
[85, 81, 19, 29, 58]
[85, 81, 58, 29, 19]