Commit 6fe4be8f by BellCodeEditor

save project

parent 8ee418d8
Showing with 29 additions and 7 deletions
......@@ -3,7 +3,7 @@ def new_inqut():
while True:
unit= input("请输入:")
if unit== 'q':
break
return total
else:
try:
a=int(unit)
......@@ -11,11 +11,34 @@ def new_inqut():
print("输入整数")
else:
total.append(a)
finally:
return unit
print(total)
def sum(money):
count=0
for i in money:
count=count+i
return count
b=new_inqut()
print(b)
\ No newline at end of file
print(sum(b))
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