Commit b58f709f by BellCodeEditor

auto save

parent 186a49c3
......@@ -5,6 +5,22 @@ def collect():
if unit=="q":
break
else:
total.append(unit)
print(total)
collect()
\ No newline at end of file
try:
int(unit)
except:
print("输入错误")
else:
total.append(unit)
print("-"*30)
return total
#result = collect()
def sum(money):
count=0
for i in money:
count=count+int(i)
return count
#result2=sum(result)
#print(result2)
import func
data=func.collect()
score=func.sum(data)
print("分数为:"+str(score))
\ 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