Python equivalent of Java Vector
hoopy_frood at my-deja.com
hoopy_frood at my-deja.com
Mon Oct 2 18:28:37 EDT 2000
Much appreciated. That's what I thought, but as a newbie I lack
confidence in the answers I usually come up with to his questions.
hoopyfrood
In article <mailman.970523466.15968.python-list at python.org>,
"Darrell Gallion" <darrell at dorb.com> wrote:
> From: <hoopy_frood at my-deja.com>
> >
> > "Does Python have something equivalent to Java's Vector? For
instance,
> > most of the time if you want to use an array you have to declare the
> > size up front. Java has a Vector class which is an array of objects
> > which grows as you add things to it.
> >
>
> See lists:
>
> tmp=[]
> tmp.append("value1")
> tmp.append(55)
> print len(tmp)
> print tmp[1]
>
> Check out the docs, lists and dictionaries are very powerful.
> And who needs to declare what's in the list!
>
> --Darrell
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list