Commit dd4cb745 by BellCodeEditor

save project

parent c8445d81
Showing with 25 additions and 24 deletions
def a(): #def a():
total = [] # total = []
while True: # while True:
unit= input("请输入$$:") # unit= input("请输入$$:")
if unit== 'q': # if unit== 'q':
break # break
else: # else:
try: # try:
unit=int(unit) # unit=int(unit)
except: # except:
print('输入错误,请重输入') # print('输入错误,请重输入')
else: # else:
total.append(unit) # total.append(unit)
finally: # finally:
print("-"*30) # print("-"*30)
return total # return total
def sum(money): #def sum(money):
count+=i # count=0
return count # for i in money:
a() #
sum(total) # count+=i
# return count
#a()
\ No newline at end of file #sum(total)
\ 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