Commit 82945358 by BellCodeEditor

save project

parent 29766708
Showing with 5 additions and 11 deletions
# 臂力挑战赛 students=["傻狍子","憨批","猪妖","坤器人"]
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中? students.pop(2)
name='刘华强' print(students)
power=66 append.students("高启强")
hero=['张三',30,'坤坤',37,'阳光开朗大男孩',52,'煞毕',89,'瓜摊老板',98] print(students)
for i in range(len(hero)):
if i%2==1 and hero[i]>=power:
hero.insert(i-1,name)
hero.insert(i,power)
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