#python #sicp
A common pattern in programs is to have a sequence of
elements that are themselves sequences, but all of a fixed length. A for statement may include multiple names in its header to "unpack" each element
sequence into its respective elements.
If you want to change selection, open document below and click on "Move attachment"
2.3 Sequencesevaluation procedure is that will be
bound to the last element of the sequence after the for statement is
executed. The for loop introduces yet another way in which the
environment can be updated by a statement.
Sequence unpacking. <span>A common pattern in programs is to have a sequence of
elements that are themselves sequences, but all of a fixed length. A for
statement may include multiple names in its header to "unpack" each element
sequence into its respective elements. For example, we may have a list of
two-element lists.
>>> pairs = [[1, 2], [2, 2], [2, 3], [4, 4]]
and wish to find the number of these pairs that have the same first an Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details