Commit 5b62e3b1 by BellCodeEditor

save project

parent 37cfd0d0
Showing with 16 additions and 11 deletions
...@@ -4,16 +4,21 @@ def new_input(): ...@@ -4,16 +4,21 @@ def new_input():
unit = input("请输入:") unit = input("请输入:")
if unit == 'q': if unit == 'q':
break break
else:
try:
a=int(money)
except:
print("请输入整数")
else: else:
total.append(money) try:
finally: a=int(unit)
print("_"*30) except:
print("请输入整数")
else:
total.append(a)
finally:
print("_"*30)
return total return total
def a(b):
c=0
for i in b:
c=c+i
return c
result = new_input() result = new_input()
print(result) pay=a(result)
\ No newline at end of file print(pay)
\ 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