Commit a1da1aed by BellCodeEditor

save project

parent 72505662
Showing with 7 additions and 5 deletions
def new_input(): def new_input():
total = [] total = []
while True: while True:
unit= input("请输入:") u= input("请输入:")
try: try:
int(unit) p=int(u)
except: except:
if unit== 'q': if u== 'q':
break break
else: else:
print("输入错误") print("输入错误")
else: continue
total.append(unit) print(type(p))
total.append(p)
print(total) print(total)
new_input() new_input()
\ 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