Commit cc0dad94 by BellCodeEditor

save project

parent 053610c0
Showing with 17 additions and 2 deletions
...@@ -5,5 +5,3 @@ a=['吕布'] ...@@ -5,5 +5,3 @@ a=['吕布']
b=['袁术','公孙瓒','关羽','张飞','刘备','曹操'] b=['袁术','公孙瓒','关羽','张飞','刘备','曹操']
a.extend(b[2:5]) a.extend(b[2:5])
print(a) print(a)
b=0
name=input('输入名字:')
power2=input('输入臂力:')
power=int(power2)
hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98]
for i in range(len(hero)):
if i%2==1 and power<=hero[i]:
hero.insert(i-1,name)
hero.insert(i,power)
b=1
break
if b==0:
hero.append(name)
hero.append(power)
print(hero)
print(hero[-6:])
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