1

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?

Omar Shehab
  • 173
  • 1
  • 8

1 Answers1

3

Look up the difference between

Append 

and

AppendTo

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

enano9314
  • 543
  • 4
  • 9