Commit 6721ccb0 by BellCodeEditor

save project

parent db0d9878
Showing with 30 additions and 31 deletions
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
"-p", "-p",
"*test.py" "*test.py"
], ],
"python.testing.pytestEnabled": false, "python.testing.pytestEnabled": true,
"python.testing.nosetestsEnabled": false, "python.testing.nosetestsEnabled": false,
"python.testing.unittestEnabled": false, "python.testing.unittestEnabled": false,
"python.testing.promptToConfigure": false "python.testing.promptToConfigure": false
......
def new_input(): # def new_input():
total = [] zx = ['爆肚',44]
while True: xx = ['米饭',2]
unit=input("请输入,按p退出:") vx = ['鱼香肉丝',32]
if unit== 'q': total = [str(zx)+zx,str(xx)+xx,str(vx)+vx]
break print(total)
else: # while True:
try: # print("菜单:"+total)
unit=int(unit) # unit=input("请输入,按q退出")
except: # if unit== 'q':
print('要输入整数') # break
else: # else:
total.append(unit) # try:
# unit=int(unit)
# except:
# print('要输入整数')
return total # else:
# total.append(unit)
price=new_input # print(total)
print('='*30) # return total
print(price) # price=new_input()
s=0 # print('=*30')
# for i in price: # print(price)
# s+=i # s=0
# print(str(s)) # for i in price:
print() # s+=i
# print(total) # print("价格是:"+str(s))
\ No newline at end of file
def new_input(): def new_input():
total = [] total = []
while True: while True:
unit=int(input("请输入,按p退出")) unit=input("请输入,按q退出")
if unit== 'q': if unit== 'q':
break break
else: else:
...@@ -19,4 +19,4 @@ print(price) ...@@ -19,4 +19,4 @@ print(price)
s=0 s=0
for i in price: for i in price:
s+=i s+=i
print(str(s)) print("价格是:"+str(s))
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