import random
# 第一题
list=[]
for i in range(20):
t=random.randint(1,100)#1-99
list.append(t)
print(list)
list_Ou=[]
for i in range(20):
if(i%2==0):
list_Ou.append(list[i])
print(list_Ou)
list_Ou=sorted(list_Ou,reverse=True)
print(list_Ou)
count=0
for i in range(20):
if(i%2==0):
list[i]=list_Ou[count]
count+=1
print(list)
运行效果: