First page Back Continue Last page Overview Graphics

Examples

>>> mammon = "The god of the world's leading religion. The chief temple is in the holy city of New York."

>>> mammon.split()

['The', 'god', 'of', 'the', "world's", 'leading', 'religion.', 'The', 'chief', 'temple', 'is', 'in', 'the', 'holy', 'city', 'of', 'New', 'York.']

>>> mammon.split(".")

["The god of the world's leading religion", ' The chief temple is in the holy city of New York', '']

>>> mammon.split(maxsplit=4)

['The', 'god', 'of', 'the', "world's leading religion. The chief temple is in the holy city of New York."]

>>> mammon.rsplit(maxsplit=4)

["The god of the world's leading religion. The chief temple is in the holy", 'city', 'of', 'New', 'York.']