On Mon, Jul 25, 2011 at 4:19 AM, David Merrick <[email protected]> wrote:


>     def append(self,item):
>          '''Adds an item to the end of the List'''
>
>          current = self.head
>          previous = None
>          while current.getNext() != None:
>              previous = current
>              current = current.getNext()
>          if current.getNext() == None:
>              previous  = previous.setNext(current)
>              current = current.setNext(item)
>

current is here the first element of your list. This element does not have a
getNext() method. Instead, if you want to use this system, you'll have to
use a (probably re-defined) getNext() method of your list class itself.

-- 
AndrĂ© Engels, [email protected]
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to