Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

how to get the Values from an expression

Sum of n-th roots of unity is zero.

n=10; for i in range(1,n): v=solve(x^i - 1,x); sum_roots = 0; m=i; for j in range(0,i): sum_roots += v[j]; # error here .. I want the values, not the expression print ' sum of n-th roots of ' ; print m; print ' is '; print sum_roots ;

How do i get the values from the list of expressions returned by solve? I have another Question-: How can I see all the member functions of any type,say expression..I have tried putting ? sfter the command, but that does not give all the member functions.

click to hide/show revision 2
No.2 Revision

how to get the Values from an expression

Sum
#Sum of n-th roots of unity is zero.

zero. n=10; for i in range(1,n): v=solve(x^i - 1,x); sum_roots = 0; m=i; for j in range(0,i): sum_roots += v[j]; # error here .. I want the values, not the expression print ' sum of n-th roots of ' ; print m; print ' is '; print sum_roots ;

;

How do i get the values from the list of expressions returned by solve? I have another Question-: How can I see all the member functions of any type,say expression..I have tried putting ? sfter the command, but that does not give all the member functions.