Because everything in Python is an object, and the vast majority of objects in Python have methods to provide functionality, this section will discuss some of the more common methods available to Python data types.
The following methods are common to most sequence types, such as lists, tuples, sets, and strings, except where indicated:
- x in seq: True if an item within the sequence is equal to x; otherwise, False is returned. This also applies to a subset of a sequence, such as looking for a specific character within a string.
- x not in seq: True if no item within the sequence is equal to x; otherwise, False is returned.
- seq1 + seq2: Concatenates two sequences; if immutable sequences...