[Tutor] doing maths on lists
cbeg at gmx.de
Mon Dec 20 11:58:49 CET 2010
I have three lists with 65 float items and would like to do the following sum:
L0 = ([sum(L0A[i]*cos(L0B[i]+L0C[i]*JME) for i in range(0,64,1))])
So it just should do a sum across all the items in the list:
+ L0A*cos(L0B+L0C*JME)= some float number
However, I always get this error:
TypeError: can't multiply sequence by non-int of type 'float'
I looked it up and there seems to be some solution using either the "for-in" command or the "map(int,...)" command but I just can't get it to work....
Any help will be very much appreciated :)
Greetings from Sydney
GRATIS! Movie-FLAT mit über 300 Videos.
Jetzt freischalten unter http://portal.gmx.net/de/go/maxdome
More information about the Tutor