May 2017
Intermediate to advanced
310 pages
8h 5m
English
Sequences are ordered sets of objects indexed by non-negative integers. Lists and tuples are sequences of arbitrary objects, strings are sequences of characters. String, tuple, and range objects are immutable. All sequence types have a number of operations in common. For all sequences, the indexing and slicing operators apply as described in the previous chapter. Note that for the immutable types, any operation will only return a value rather than actually change the value.
All sequences have the following methods:
|
Method |
Description |
|
len(s) |
Number of elements in s |
|
min(s, [,default=obj, key=func]) |
The minimum value in s (alphabetically for strings) |
|
max(s, [,default=obj, key=func]) |
Maximum value in s (alphabetically ... |