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