Commit 7265cdf7 by BellCodeEditor

save project

parent 662236aa
Showing with 10 additions and 7 deletions
# 臂力挑战赛
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
name='小月'
power=999
name2='您配吗'
power1=998
hero=['王者荣耀',888,'我不配',977,'dream',596,'霍雨浩',345]
name='您配吗'
power=100
name1='Geroge'
power1=98
hero=['豌豆射首',20,'王者荣耀',23,'我不配',67,'dream',100,'霍雨浩',100]
# 自动排序
for i in range(len(hero)):
if i%2==1 and hero[i]>=power:
hero.insert(i-1,name,i-1,name2)
hero.insert(i,power,i,power1)
hero.insert(i-1,name)
hero.insert(i,power)
hero.insert(i-1,name1)
hero.insert(i,power1)
print(hero)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment