If I start out with a list A
with $n$ elements in it, how do I append elements to it until it has a length $N$?
For example if A={1,2,3,4}
, and suppose I want to append the element 3.14
to A
until the length of A
is 10. I tried doing this with a While loop as follows:
While[Length[A]<10,Append[A,3.14]]
However Mathematica gets stuck computing it. How can one do this?