Commit 74f062b2 by BellCodeEditor

save project

parent 365f2b64
Showing with 6 additions and 22 deletions
def yhd():
def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:(输入q可退出)") unit= input("请输入:")
if unit== 'q': if unit== 'q':
break break
else: else:
try: total.append(unit)
unit=int(unit) print(total)
except: yhd()
print("请输入一个整数") \ No newline at end of file
else:
total.append(unit)
print(30*'*')
return total
a=new_input()
print(a)
def sum(money):
k=0
for i in money:
k+=i
print(k)
return sum
b=sum(a)
print('您一共消费了'+str(money)+'元,扫码还是现金?')
\ 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