Stephen P. Molnar wrote:

> However, what I want to do is multiply each element ob D by each element
> of s and sum all of the products.

If you *really* want this: 

sum_of_all_products = s.sum() * D.sum()

example:

s = [a b c]

D = [[a1 a2]
     [a3 a4]]

a*a1 + a*a2 + a*a3 + a*a4 = a * D.sum()

d := D.sum()
a*d + b*d + c*d = s.sum() * d

Even if that's what you want you should heed Steven's advice.




_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to