Python Strings: Creating, Indexing and Slicing
A string is an immutable ordered sequence of characters. Indexing reaches one character, slicing reaches a range, and negative numbers count from the...
Creating, indexing and slicing text, string methods, text processing and every formatting style.
5 notes
A string is an immutable ordered sequence of characters. Indexing reaches one character, slicing reaches a range, and negative numbers count from the...
Concatenation, repetition, membership testing, comparison and iteration - the operations that work on strings because a string is a sequence.
Case conversion, whitespace trimming, searching, counting and the is-something tests, organised by the job they do rather than alphabetically.
split turns text into a list, join turns a list back into text, and between those two calls sits most of the text processing you will ever write.
Three formatting styles exist. f-strings are the one to use, and the format specification they share controls width, alignment, precision and thousand...