Commit 2de051d3 by BellCodeEditor

save project

parent 380c1391
Showing with 12 additions and 6 deletions
def new_input(): def new_input():
total = [] total = []
zong=0
while True: while True:
unit= input("请输入:") unit= input("请输入(退出按q):")
if unit== 'q': if unit== 'q':
break break
else: else:
try: try:
unit= unit=int(unit)
total.append(unit) except:
print(total) print("请输入正确的价格")
new_input() else:
\ No newline at end of file zong=zong+unit
print("总共花费")
return zong
a=new_input()
print(a)
\ 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