[sage-support] how to get a list of terms of expression such as x+z^2 in gap system

2014-09-28 Thread Martin Chan
how to get a list of terms of expression such as x+z^2; how to convert to a list [x, z^2] for for loop to get each terms? -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [sage-support] how to get a list of terms of expression such as x+z^2 in gap system

2014-09-28 Thread Vincent Delecroix
Hello, I am not sure this is what you want sage: var('x,y') (x, y) sage: expr = x + y^2 sage: expr.operands() [y^2, x] Vincent -- You received this message because you are subscribed to the Google Groups sage-support group. To unsubscribe from this group and stop receiving emails from it,

Re: [sage-support] how to get a list of terms of expression such as x+z^2 in gap system

2014-09-28 Thread Martin Chan
thank you. actually i mean in gap system i solved with poly1 := 0; for j in [1..Length(prepoly1[1])] do zz:=1; for i in SplitString(String(prepoly1[1][j]), + ) do zz:=zz*EvalString(i); od; if zz 1 then poly1 := poly1 + zz; fi; od; vdelecroix於 2014年9月28日星期日UTC+8下午5時24分34秒寫道: