Commit 7b31e896 by BellCodeEditor

save project

parent 6989e53e
Showing with 7 additions and 3 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
# 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~ # 请优化刚刚的代码,并增添交互效果,和自动输出最强三人信息的功能~
# 问询处 # 问询处
name=float(input('what is your name?')) name=input('what is your name?')
power=float(input('how much is your power?')) power=float(input('how much is your power?'))
# 归档处 # 归档处
...@@ -13,10 +13,14 @@ for i in range(len(hero)): ...@@ -13,10 +13,14 @@ for i in range(len(hero)):
hero.insert(i-1,name) hero.insert(i-1,name)
hero.insert(i,power) hero.insert(i,power)
break break
else:
hero.append(name)
hero.append(power)
break
# 打印出臂力最强的三个人和他们对应的臂力值: # 打印出臂力最强的三个人和他们对应的臂力值:
print(hero[-6:-1]) 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