Commit 5a095f29 by BellCodeEditor

save project

parent 2f99873a
Showing with 30 additions and 12 deletions
def ji():
total=
\ No newline at end of file
total=[]
while True:
a=input('请输入')
if a=='q'
break
else:
......@@ -11,9 +11,9 @@ def ji():
print('重新输入')
else:
total.append(a)
return total
b=ji()
print(b)
print(total)
ji()
......
total = []
while True:
unit= input("请输入:")
if unit== 'q':
def ji():
total=[]
while True:
a=input('请输入')
if a=='q':
break
else:
total.append(unit)
print(total)
\ No newline at end of file
try:
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