Commit 25291226 by BellCodeEditor

save project

parent d9e6e8bb
Showing with 11 additions and 1 deletions
...@@ -2,10 +2,15 @@ ...@@ -2,10 +2,15 @@
def diancai(): def diancai():
total = [] total = []
while True: while True:
unit= input("请输入:") unit=input("请输入菜!")
if unit== 'q': if unit== 'q':
break break
else: else:
try:
unit=int(unit)
except:
print("请输入数字!")
else:
total.append(unit) total.append(unit)
print(total) print(total)
......
try:
a=int(input("你今年几岁啊?"))
except:
print("请输入整数!")
print("好!")
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