diy.py 387 Bytes Edit 1 2 3 4 5 6 7 8 9 10 11 12 # 臂力挑战赛 # 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中? name='特朗普' power=66 hero=['拜登',30,'曼德拉',37,'罗斯福',52,'肯尼迪',89,'李根',98] # 自动排序 for i in range(len(hero)): if i%2==1 and hero[i]>=power: hero.insert(i-1,name) hero.insert(i,power) break print(hero)