Commit 6fe4be8f by BellCodeEditor

save project

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