From bcf82fe492ef285a336be68aa92ac7623e8b299b Mon Sep 17 00:00:00 2001 From: BellCodeEditor <bellcode_dev@bell.ai> Date: Wed, 4 Aug 2021 20:00:58 +0800 Subject: [PATCH] save project --- diy.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/diy.py b/diy.py index 2348563..5d8c35c 100644 --- a/diy.py +++ b/diy.py @@ -1,15 +1,15 @@ # 古代测量臂力是靠不同重量的石锁,只能测整数哦。 # 最小的石锁是30公斤最大的石锁是100公斤,注意输入的数字哦。 # 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~ - +name=input("你叫啥') +power=int(input("你比例多少")) # 问询处 - - # 归档处 hero=['赵一',30,'丁二',37,'孙五',52,'王猛',89,'周亮',98,'张宇',100] for i in range(len(hero)): - - - - + if i%2==1 and here[i]>=power: + hero.insert(i-1,name) + hero.insert(i,power) + break +print(hero[-6:]) # 打印出臂力最强的三个人和他们对应的臂力值: -- libgit2 0.25.0