This works:

sage: n=6
sage: R=PolynomialRing(QQ,n,'z')
sage: z=R.gens()
sage: g=sum(z[i] for i in range(n))
sage: g.subs(dict((z[i], i) for i in range(n)))
15

--Mike

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to