Ask Your Question

Revision history [back]

If you have

P=7*x^3+2*x^4+2

then type P.[TAB] to see a list of possible "attributes" or "methods" attached to P. Other people have mentioned P.coefficients(). You might also hope that there is something like a leading_coefficient method, so try P.l[TAB] to find everything starting with the letter l. Then you should see P.leading_coefficient, so type

P.leading_coefficient?

to find out how to use it.