Python equivalent of Java Vector

David Goodger dgoodger at bigfoot.com
Mon Oct 2 23:20:57 EDT 2000


on 2000-10-02 17:19, hoopy_frood at my-deja.com (hoopy_frood at my-deja.com)
wrote:
> "Does Python have something equivalent to Java's Vector?

Not familiar with Java, but what you describe sounds exactly like a Python
list:

    >>> list = []
    >>> list.append('a')
    >>> list.append('b')
    >>> list.append(3)
    >>> list
    ['a', 'b', 3]
    >>> len(list)
    3
    >>> list[1]
    'b'
    >>> list[2] = "X"
    >>> list
    ['a', 'b', 'X']

-- 
David Goodger    dgoodger at bigfoot.com    Open-source projects:
 - The Go Tools Project: http://gotools.sourceforge.net
 (more to come!)




More information about the Python-list mailing list