[Tutor] DeleteNode

Isaac Isaac@compuserve.com
Sat, 15 Jul 2000 13:57:12 -0700


I try to use my "reply-all" button when on an e-mail list (unless I don't
think the list should see what I'm saying) since most lists don't set a
reply-to field with the list name (which keeps some unwanted traffic off the
lists, but sometimes ends up keeping wanted traffic off, too.)

Daniel Yoo wrote:

>
> On Fri, 14 Jul 2000, Vanessa Green wrote:
>
> > I have a question concerning how to delete a node using python.  I am
> > new to programming and python is the first language that I am slowly
> > learning.  Would you please let me know the best way to go about
> > deleting a node that contains both strings and integers.  Also is it
> > neccessary for me to create a key.
>
> Hello!  Can you explain what you mean by a node?  I'm familiar with the
> term 'node' when it's applied to linked-lists, but since you're doing
> beginning programming, I'm not sure if that's what you mean.  I'll try to
> guess what you mean, but if I starts sounding silly, you can ignore
> me.  *grin*
>
> If you mean an element in a hashtable like:
>
>   names_ages = { "al" : 23, "sandy" : 29, "goofy" : 3 }
>
> then the way to remove 'goofy' from the hashtable is to use the 'del'
> operator.
>
>   del names_ages["goofy"]
>
> If you do this, names_ages will just contain values for 'al' and 'sandy':
>
>   >>> names_ages
>   {'sandy': 29, 'al': 23}
>
> Oh, when you reply, make sure you reply to tutor@python.org.  (I haven't
> been able to figure out how to fix 'reply-to' in piX-Mozilla-Status: 0009________________________________________
> Tutor maillist  -  Tutor@python.org
> http://www.python.org/mailman/listinfo/tutor