Commit 2df64ca3 by BellCodeEditor

save project

parent 1ed81e92
Showing with 8 additions and 4 deletions
...@@ -2,16 +2,16 @@ def new_input(): ...@@ -2,16 +2,16 @@ def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:") unit= input("请输入:")
if break== 'q': if unit== 'q':
break break
else: else:
try: try:
break=int(break) unit=int(unit)
except: except:
print("请输入一个数字") print("请输入一个数字")
else: else:
total.append(break) total.append(unit)
rinally: finally:
print("-"*30) print("-"*30)
return total return total
......
import func
data=func.new_input()
score = func.sum(data)
print("这位选手的总分数为:"+str(score))
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