Commit d38d7e3b by BellCodeEditor

save project

parent 8e7a3ab1
Showing with 32 additions and 2 deletions
print("hello world")
\ No newline at end of file
def new_input():
T=[]
while True:
unit=input('请输入q退出')
if unit=='q':
break
else:
try:
unit=int(unit)
except:
print("请输入一个数字")
else:
T.append(unit)
return T
def sum(money):
u=0
for i in money:
u=u+1
return u
price=new_input()
pay=sum(price)
print('消费了'+str(pay))
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