Commit 5a095f29 by BellCodeEditor

save project

parent 2f99873a
Showing with 32 additions and 14 deletions
def ji(): def ji():
total= total=[]
\ No newline at end of file while True:
a=input('请输入')
if a=='q'
break
else:
...@@ -11,9 +11,9 @@ def ji(): ...@@ -11,9 +11,9 @@ def ji():
print('重新输入') print('重新输入')
else: else:
total.append(a) total.append(a)
return total print(total)
b=ji() ji()
print(b)
......
total = [] def ji():
while True: total=[]
unit= input("请输入:") while True:
if unit== 'q': a=input('请输入')
break if a=='q':
else: break
total.append(unit) else:
print(total) try:
\ No newline at end of file a=int(a)
except:
print('重新输入')
else:
total.append(a)
return total
def sum(money):
cont=0
for i in money:
cont=cont+i
return cont
c=ji()
d=sum(c)
print('总共花了'+str(d)+'元')
\ 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