1
$\begingroup$

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$
3
$\begingroup$

Look up the difference between

Append 

and

AppendTo

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

| improve this answer | |
$\endgroup$

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