COMPSCI 61A Chapter Notes - Chapter 2.3: List Comprehension, Berkeley, California, String Literal
zogo39484755 and 6 others unlocked
22
COMPSCI 61A Full Course Notes
Verified Note
22 documents
Document Summary
7:58 pm sequence - an ordered collection of values; a data structure consisting of an indexed collection of values. A sequence can be finite (with a certain length) or infinite. Sequences can be mutable (elements can change) or immutable (elements cannot change) Types of sequences tuples (immutable) lists (mutable) ranges. Tuples tuple - immutable sequences (, , , ,) Lists list - a list value is a mutable sequence that can have arbitrary length. Multiplying a list with an integer replicates the sequence that integer number of times. Adds an element onto a mutable sequence from the end (it does not create a new list (a copy of the list)) 4 gets added onto the end of the object a points to, a and. b still point to the same object extend. Adds a list onto the end of a mutable sequence (it does not create a new list (a copy of the list))