#python #sicp
If only one argument is given, it is interpreted as one beyond the last value
for a range that starts at 0.
>>> list ( range ( 4 )) [0, 1, 2, 3]
If you want to change selection, open document below and click on "Move attachment"
2.3 Sequences(1, 10) # Includes 1, but not 10
range(1, 10)
Calling the list constructor on a range evaluates to a list with the same
elements as the range, so that the elements can be easily inspected.
>>> list(range(5, 8))
[5, 6, 7]
<span>If only one argument is given, it is interpreted as one beyond the last value
for a range that starts at 0.
>>> list(range(4))
[0, 1, 2, 3]
Ranges commonly appear as the expression in a for header to specify the
number of times that the suite should be executed: A common convention is to
use a single underscore charac Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details