Commit f6bf8ba6 by BellCodeEditor

save project

parent 107ea6d7
Showing with 18 additions and 7 deletions
def new_input(): def new_input():
tatol=[] tatol=[]
while True: while True:
unif=int(input("请输入:")) unif=input("请输入:")
if unif=="q": if unif=="q":
break break
try: # try:
unif=int() # unif=int(tatol)
except: # except:
print("请再输入一个数") # print("请再输入一个数")
else: # else:
tatol.append(unif) tatol.append(unif)
print(tatol) print(tatol)
return tatol return tatol
result=new_input() #result=new_input()
def sum(money):
count = 0
for i in money:
count=count+i
return count
price = new_input()
pay=sum(price)
print("您一共消费了"+str(pay)+"元!扫码还是现金?")
\ 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