> Is there a Sage equivalent to Maple's "nops" command, which counts the > number of operands in an expression? In particular, is there a > command which returns the number of terms of something like > > expand((1+x+1/x)^10) ? >
There's probably a classier way to do it, but this works: sage: len(expand((1+x+1/x)^10).coeffs()) 21 -cc --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---