def new_input(): total = [] while True: unit= input("请输入:(输入q退出)") if unit== 'q': break else: total.append(unit) print(total) new_input()