Commit 033bb406 by BellCodeEditor

auto save

parent c4b0be15
Showing with 5 additions and 6 deletions
# 臂力挑战赛
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
name='刘华强'
power=66
hero=['赵云',30,'丁真',37,'孙悟空',52,'王霸但',89,'周瑜',98]
power=6
hero=['赵云',30,'丁真',5555555555555,'孙悟空',208200114514,'王霸但',8888888888888,'次 爱虚鲲'',1145141145142.5]
# 自动排序
for i in range(len(hero)):
if i%2==1 and hero[i]>=power:
hero.insert(i-1,name)
hero.insert(i,power)
for i in rang():
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