Please enable JavaScript to use CodeHS

APCSP20: AAP-1.D.7

CodeHS Lessons

The exam reference sheet provides the notation [value1, value2, value 3…] to create a list with those values as the first, second, third… items. For example, aList ← [value1, value2, value3,...] - creates a new list that contains the values value1, value2, value3, and … at indices 1, 2, 3, and … respectively and assigns it to aList. aList  [] – creates a new empty list and assigns it to aList. aList  bList – assigns a copy of the list bList to the list aList. For example, if bList contains [20, 40, 60], then aList will also contain [20, 40, 60] after the assignment.