You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vector_sum is supposed to take a list of "vectors" (that is, a list of lists) and vector_add them together. you're giving it a vector. it should work if you did
vector_sum([[1, 2, 3, 4]]) # a list with one 4-vector
or
vector_sum([[1], [2], [3], [4]]) # a list of four 1-vectors
Hey, working through some of the examples and it seems the below code is not set up properly even though vector_add has been defined:
def vector_sum2(vectors):
return reduce(vector_add, vectors)
When I try and run the below in the ipython console I get an error saying: "zip argument #1 must support iteration"
vector_sum([1,2,3,4])
Please could you verify that the code is correct/incorrect?
Many thanks!
The text was updated successfully, but these errors were encountered: