Commit 4301e433 by BellCodeEditor

save project

parent 28b51d3f
Showing with 9 additions and 3 deletions
...@@ -10,5 +10,12 @@ bros[1] = "刘备" ...@@ -10,5 +10,12 @@ bros[1] = "刘备"
print(bros) print(bros)
b=["刘备","关羽", "张飞"] b=["刘备","关羽", "张飞"]
print(b[2) print(b[2)
hero=["0",30,"2",37,"4",52,"6",66,"8",89,"10",98] name='刘强'
name='' power=66
\ No newline at end of file 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)
print(hero)
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