Commit 9f0126b0 by BellCodeEditor

save project

parent a51a07af
def new_input ():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
return(total)
break
def new_input():
total = []
while True:
unit = input("请输入:")
if unit == 'q':
return (total)
break
else:
try :
int(unit)
except :
try:
int(unit)
except:
print("输入整数")
else:
print("-"*30)
total.append(unit)
print(total)
new_input()
\ No newline at end of file
else:
print("-" * 30)
total.append(int(unit))
# print(total)
# return total
#ew_input()
def 统计分数(arr):
total = 0
for i in range(len(arr)):
total += arr[i]
return (total)
\ No newline at end of file
import func
date = func.new_input()
score = func.统计分数(date)
print("这位选手的总分是", 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