คลาสรายการในตัวของ Python มีเมธอด append() เราสามารถรับข้อมูลของผู้ใช้และเพิ่มลงในรายการจนกว่าผู้ใช้จะกดปุ่ม Enter infinite while loop มีฟังก์ชัน input() และ append() method
L=[]
while True:
item=input("enter new item")
if item=='':
break
L.append(item)
print ("List : ",L)