This is newbie question. I am working on something called sagemath which is completely based on Python.
My code is two parts: The first part is:
var('a,b')
my_list=list(powerset([a,b]))
my_possible_products_list=[]
for i in my_list:
if len(i)!=0:
my_possible_products_list.append(prod(i))
print my_possible_products_list
with an ouput
[a, b, a*b]
i.e, the result is a list of all possible product expressions on a set of two variables.
The second part:
for expression_compute in my_possible_products_list:
for l in range(1,3):
for a in divisors(l):
for b in divisors(l):
print expression_compute
with an output
a
a
a
a
a
b
b
b
b
b
a*b
a*b
a*b
a*b
a*b
The problem: I need to have numerical output, not using a and b, but using the values of a and b as divisors of the given l.
Any hint?
Thanks.