By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,363 Members | 1,708 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,363 IT Pros & Developers. It's quick & easy.

RE: list/tuple/dict question

P: n/a
Hi Fredrik...

so, this still doesn't get me an array called 'cat', or 'dog'

or do i somehow use stuff to add/extract the vals...???

thanks
-----Original Message-----
From: py*****************************************@python .org
[mailto:py***************************************** @python.org]On Behalf
Of Fredrik Lundh
Sent: Sunday, August 17, 2008 2:27 PM
To: py*********@python.org
Subject: Re: list/tuple/dict question
bruce wrote:
a dict doesn't seem to work, as it is essentially a series of key/values,
which isn't exactly what i want...
so what do you think a variable namespace is?

as usual, Python works best if you use it to write Python program, and
in Python, the right way to store a collection of name/value pairs is to
use a dictionary:

stuff = {}

foo = []
foo.append('cat')
foo.append('dog')

stuff[foo[1]] = []

</F>

--
http://mail.python.org/mailman/listinfo/python-list
Aug 17 '08 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.