[Tutor] lists [Linked lists]

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Tue, 23 Apr 2002 13:57:21 -0700 (PDT)


> Here's how we can work with them:
>
> ###
> >>> mylist = Cons(1, Cons(2, Cons(3, NULL_LIST)))
> >>> mylist
> <__main__.Cons instance at 0x81156ec>
> ###
>
> 'mylist' is now a list of three elements.  We can get at the value of the
> head of our list by doing a elements when we yank on the "head" of our
> list.

??!  Sorry about the unreadability of that last sentence.  It used to be
two sentences, but I merged the sentences together... but didn't merge it
correctly. I meant to say:

"""
We can grab at the very first value in our list by yanking at the "head"
of our list.
"""