Commit 389d2de2 by BellCodeEditor

save project

parent 05e7d622
def func1():
total = []
while True:
try:
unit= int(input("请输入:"))
except:
print("輸入錯誤")
else:
if unit == -1:
print("程序結束")
break
else:
total.append(unit)
return total
def sum(x):
count = 0
for i in x:
count=count + i
return count
import func
a = func.func1()
print(a)
zongshu = func.sum(a)
print("总分是:"+str(zongshu))
\ 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