Hi!

On 16 Nov., 10:08, Chappman <[email protected]> wrote:
> HI folks,
>
> In Sagemath I am trying to compute this
>
> a=[1,1]
>
> b=[4,3]
>
> b-a=[3,2]

[1,1] in Python (thus, also in Sage) is a list. Lists can't be added
or subtracted.

What you probably want is a vector:
  sage: a = vector([1,1])
  sage: b = vector([4,3])
  sage: b-a
  (3, 2)

Best regards,
Simon


> the answer I want is b-a=[3,2] but in sage i come up with a type
> Error: unsupported operand type(s) for -: 'list' and 'list'.
>
> Is there any way of rectifying this problem and so that I can compute
> b-a ?
>
> Kind Regards
> Chappman

-- 
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
URL: http://www.sagemath.org

Reply via email to