Commit 31f93443 by BellCodeEditor

save project

parent dc70412a
def newinput():
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
try:
n=int(unit)
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