AnsweredAssumed Answered

Question re: list.extend

Question asked by Kinny_K on Jan 26, 2016
Latest reply on Jan 26, 2016 by lpinner

I'm a new Python student. Using a loop, I need to add to a list. The following is not working. Not sure what I'm missing or if my logic is bad.

 

#Variables

myList = []

item = ''

 

#Create name list

item = raw_input("Please enter a name or blank to quit: ")

while item <> '':

    myList.extend(item)

 

printmyList

 

Traceback (most recent call last):

  File "C:/Users/ken/Desktop/HW4b.py", line 14, in <module>

    myList.extend(item)

MemoryError

 

Thanks ... Ken

Outcomes