Commit 557920c1 by BellCodeEditor

save project

parent 9f46f877
Showing with 8 additions and 6 deletions
...@@ -2,15 +2,17 @@ def new_input(): ...@@ -2,15 +2,17 @@ def new_input():
total = [] total = []
while True: while True:
try: try:
unit=int(unit=input("请输入:")) unit=unit=input("请输入:")
unit=int(unit)
if unit== 'q': if unit== 'q':
break break
total.append(unit)
print('保存好了')
except: except:
print('要输入整型哦~') print('要输入整型哦~')
print('程序结束,你个***') print('程序结束')
else:
print('已经保存了哦~')
else: else:
total.append(unit) total.append(unit)
return total return total
new_input() resrult = new_input()
\ No newline at end of file print(resrult)
\ 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