Commit 5802f3e5 by BellCodeEditor

save project

parent dc70412a
def aaa():
total=[]
while True:
unit= input("请输入:")
if unit== 'q':
print('-'*30)
break
else:
try:
unit=int(unit)
except:
print('请输入整数')
else:
total.append(unit)
finally:
print('-'*30)
return total
def s(m):
w=0
for i in m:
w=w+i
return w
e=aaa()
r=s(e)
#print('一共消费'+str(r)+'元,扫码还是支付宝?')
\ No newline at end of file
import func
x=func.aaa()
c=func.s(e)
print('一共得了'+str(c)+'分')
\ 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