Python的内置列表类具有append()方法。我们可以获取用户输入并将其添加到列表中,直到用户按下Enter键为止。无限的while循环包含input()函数和append()方法
append()
input()
L=[] while True: item=input("enter new item") if item=='': break L.append(item) print ("List : ",L)
友情链接: json在线解析 通晓查询 糯晒黄历 姓名打分