Commit 01c611b9 by BellCodeEditor

save project

parent 5a95e81e
Showing with 30 additions and 13 deletions
# 臂力挑战赛
# 快用你机灵的小脑瓜想想,如何将刘强和他的臂力值自动插入到hero列表中?
name=input('叫啥?')
power=int(input('臂力多少'))
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[-6:])
\ No newline at end of file
def new_input()
total = []
while True:
unit = input('请输入:')
if unit == 'q':
break
else:
try:
unit = int(unit)
except:
print("请重新输入一个数字")
else:
total.append(unit)
finally:
print("=============================")
return total
def sum(money):
co
\ No newline at end of file
text=["p","y","t","h","o","n"]
new_text="".join(text)
print(new_text)
\ No newline at end of file
import func
date = func.new_input()
score = func.sum(data)
print('这位选手的总分数为:'+str(score))
\ No newline at end of file
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