From 4402a4fddf4a259224c81fc0e18f6ef0d6ca9ba1 Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Mon, 3 Jul 2023 10:46:57 +0800 Subject: [PATCH] save project --- diy.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/diy.py b/diy.py index 2348563..56a2cd4 100644 --- a/diy.py +++ b/diy.py @@ -3,13 +3,15 @@ # 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~ # 问询处 - +name='杰哥' +power=66 # 归档处 -hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98,'张宇',100] +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[-6:]) # 打印出臂力最强的三个人和他们对应的臂力值: -- libgit2 0.25.0