Ask Your Question

Revision history [back]

x[0] holds the arguments to foo, x[1] holds the output :) Try

sage: @parallel
....: def foo(n):
....:         return str(factor(n))
....:     
sage: foo(10)
'2 * 5'
sage: for x in foo([1..10]):
....:         print x[0][0][0],'->', x[1]
....: 
2 -> 2
1 -> 1
3 -> 3
4 -> 2^2
5 -> 5
6 -> 2 * 3
7 -> 7
8 -> 2^3
9 -> 3^2
10 -> 2 * 5