Commit 251d072d by BellCodeEditor

save project

parent dc70412a
Showing with 22 additions and 0 deletions
def new_input():
count=0
total = []
while True:
unit= input("请输入:")
if unit== 'q':
break
else:
try:
int(unit)
except:
print("要输入数字")
else:
count=count+int(unit)
total.append(unit)
print(30*'*')
return count
result=new_input()
print("你一共消费了"+str(result)+"元")
\ 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