We can redo Example TLC with Sage. First we build the relevant vectors and then do the computation.
With a linear combination combining many vectors, we sometimes will use more compact ways of forming a linear combination. So we will redo the second linear combination of $\vect{u}_1,\,\vect{u}_2,\,\vect{u}_3,\,\vect{u}_4$ using a list comprehension and the sum() function.
We have constructed two lists and used a list comprehension to just form the scalar multiple of each vector as part of the list multiples. Now we use the sum() function to add them all together.
We can improve on this in two ways. First, we can determine the number of elements in any list with the len() function. So we do not have to count up that we have 4 vectors (not that it is very hard to count!). Second, we can combine this all into one line, once we have defined the list of vectors and the list of scalars.
The corresponding expression in mathematical notation, after a change of names and with counting starting from 1, would roughly be: \begin{align*} \sum_{i=1}^4 a_i\vect{u}_i \end{align*} Using sum() and a list comprehension might be overkill in this example, but we will find it very useful in just a minute.