Commit 1b7a7819 by BellCodeEditor

auto save

parent a53e705a
Showing with 10 additions and 4 deletions
...@@ -5,10 +5,17 @@ def a(): ...@@ -5,10 +5,17 @@ def a():
if unit== 'q': if unit== 'q':
break break
try: try:
int(unit) unit=int(unit)
except: except:
print('输入整数,重输') print('输入整数,重输')
else: else:
total.append(unit) total.append(unit)
print(total) return total
a() def b(money):
\ No newline at end of file count=0
for i in money:
count=count+i
return count
abc=a()
pay=b(abc)
print("您消耗了"+str(pay)+"元,扫码")
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