单选题

阅读以下程序,请问程序运行后,最后的输出结果是?

  1. ls = [8158192985]

  2. for i in range(2):

  3. max = 0

  4. for j in range(i,len(ls)):

  5. if ls[j] > max:

  6. max = ls[j]

  7. max_index = ls.index(max)

  8. temp = ls[i]

  9. ls[i] = max

  10. ls[max_index] = temp

  11. print(ls)

A

[81, 58, 19, 29, 85]

B

[85, 58, 19, 29, 81]

C

[85, 81, 19, 29, 58]

D

[85, 81, 58, 29, 19]

赣ICP备20007335号-2