title: Function and vector
body: <p>I am just starting to learn how to program in python. In relation I have an assignment, it sounds:</p>
  <p><em>The projection of a vector b onto a vector a is a vector p which contains the vector component of b in the direction of a.
  The projection can be computed using the following formula: p = (a</em>b)/|a|^2<em>a
  where |a| denotes the magnitude of the vector a (and similar for b). The magnitude of the vector can be computed using Pythagoras’ formula.
  Create a function named computeProjection that computes the projection of the vector b = [1, 1, . . . ] onto the vector a which is taken as an input to the function. The output must be the projection p. Note that b is a vector with all elements equal to one and with the same dimensions as a, and that the function should work for vectors of any dimensionality.</em></p>
  <p>My question is: How do I create a variable that can contain vectors of any dimension.</p>