From 2f09b3a45f739d1c1bcb8338f99df74b06e98b46 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Sun, 18 Oct 2020 12:08:18 +0800 Subject: [PATCH] save project --- diy.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/diy.py b/diy.py index c44417b..7017adb 100644 --- a/diy.py +++ b/diy.py @@ -4,9 +4,9 @@ name='刘强' power=66 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) + break print(hero) \ No newline at end of file -- libgit2 0.25.0