Hi Alex

    Thanks for the quick reply. By _ you mean a variable? I tried your
syntax but it does not work.
    However, [2*x for x in [3,4]] does work.


On Oct 18, 9:26 pm, "Alex Ghitza" <[EMAIL PROTECTED]> wrote:
> I'm not sure this is what you're hoping for, but it does the trick:
>
> sage: [2*_ for _ in [3,4]]
> [6,8]
>
> Best,
> Alex
>
> On Sun, Oct 19, 2008 at 3:22 PM, pong <[EMAIL PROTECTED]> wrote:
>
> > Is there any bulit-in function of sage which can multiply each element
> > of a list of numbers by a constant?
>
> > e.g. I want 2*[3,4] = [6,8]
>
> > without calling pari/gp.
>
> > Thanks in advance
>
> --
> Alex Ghitza -- Lecturer in Mathematics -- The University of Melbourne --
> Australia --http://www.ms.unimelb.edu.au/~aghitza/
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-support@googlegroups.com
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to