How can I create a linked list in Python?

ray223 at gmail.com ray223 at gmail.com
Tue Jan 16 17:21:52 EST 2007


Dongsheng Ruan wrote:
> with a cell class like this:
>
> #!/usr/bin/python
>
> import sys
>
> class Cell:
>
>  def __init__( self, data, next=None ):
>   self.data = data
>   self.next = next
>
>  def __str__( self ):
>   return str( self.data )
>
>  def echo( self ):
>   print self.__str__()


Hi,

The "How to Think Like a Computer Scientist" free book has a chapter
just for this topic:

http://greenteapress.com/thinkpython/html/chap17.html

Regards,

Ray Smith
http://RaymondSmith.com




More information about the Python-list mailing list