Yes, that is exactly what I wanted! Thanks!
On May 18, 9:22 pm, Jason Grout <jason-s...@creativetrax.com> wrote:
> Minh Nguyen wrote:
> > Hi,
>
> > On Tue, May 19, 2009 at 3:35 AM, wkehowski <wkehow...@cox.net> wrote:
> >> Hello,
>
> >> How would one find the list of variables in a monomial?
>
> >> For example,
>
> >> (p^2 * q^3).exponents()
>
> >> returns
>
> >> [(2,3)]
>
> >> (without using a ring).
>
> >> Is there a command that will return something like [(p,q)] or [(p,2),
> >> (q,3)]?
>
> > Is this what you want?
>
> > [mv...@sage ~]$ sage
> > ----------------------------------------------------------------------
> > | Sage Version 3.4.2, Release Date: 2009-05-05 |
> > | Type notebook() for the GUI, and license() for information. |
> > ----------------------------------------------------------------------
> > sage: p, q = var("p, q")
> > sage: f = p^2 * q^3
> > sage: f.variables()
> > (p, q)
>
> Or:
>
> sage: var("p,q")
> (p, q)
> sage: f=p^2*q^3
> sage: f.factor_list()
> [(p, 2), (q, 3)]
>
> Jason
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---