1
$\begingroup$

This question already has an answer here:

I am trying to create an empty list and add an element but the list is not being populated.

My code

configsPermTerms = List[]; Append[configsPermTerms, {{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,     0, 0}, 8}] Length[configsPermTerms] configsPermTerms

Output

{{{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, 8}}
0
{}

What am I doing wrong?

$\endgroup$

marked as duplicate by march, Daniel Lichtblau, Sjoerd C. de Vries, QuantumDot, RunnyKine Apr 8 '16 at 21:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3
$\begingroup$

Look up the difference between

Append 

and

AppendTo

Append doesn't reassign the value of the List, while AppendTo does.

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.