On Wed, Apr 22, 2009 at 8:14 PM, gellmu <[email protected]> wrote:
>
> In SAGE I can do
> pari('"ABC"').Vecsmall()
>
> But if I do
> s="ABC"
> I cannot find a way to accomplish
> the same thing referring only to the
> variable name 's'.
>
> Any clues? Thanks.
One of the following examples probably answers your question:
sage: pari('"ABC"').Vecsmall()
Vecsmall([65, 66, 67])
sage: s="ABC"
sage: list(s)
['A', 'B', 'C']
sage: [ord(t) for t in s]
[65, 66, 67]
sage: vector([ord(t) for t in s])
(65, 66, 67)
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---