Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

accessing the components of a vector

Is there a command in Sage that allows me to access the individual components of a vector? For example, suppose I've defined a vector like a=vector([1,2,3]). I want a command like "a.1" that returns the first component of the vector, so in this case I would want a.1 to return 1. Is there a command like this in Sage? Thanks!