Commit 473dad4f by BellCodeEditor

save project

parent 578e41ee
total = [] def newinput():
while True: total = []
unit= input("请输入:") while True:
if unit== 'q': unit= input("请输入:")
break if unit== 'q':
else: break
total.append(unit) try:
print(total) n=int(unit)
\ No newline at end of file except:
print("请输入整数")
else:
total.append(n)
print(total)
return total
def sum(A):
B=0
for i in A:
B=B+i
return B
import func
N=func.newinput()
H=func.sum(N)
print("总分数是:"+str(H))
\ 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