Loading topic
str literals and indexing, know what lists and tuples are, and can read simple if statements and for loops.2 min readif statements and for loops. It covers the in operator, the simplest way to ask whether one string appears inside another.2 min readif and while statements. The previous chapter used in to ask whether text is present. Here you will ask where it is.2 min readif statements. It also assumes you know that string methods return new values instead of changing the original. Here you will use str.count to tally substrings, restrict the search to part of a string, and handle the cases2 min readif statements and for loops. You will learn how startswith and endswith work, how to test several alternatives at once, and which mistakes to avoid.2 min readstr methods return new strings, which the earlier chapter on immutability covered. It also assumes you can read basic function calls and if statements. Here you will learn the five case-changing methods, what each one does to the rest of the string, and where t2 min readstr methods return new strings, and that you can use in, find, and lower. It builds on those to compare and search text without caring about case.2 min readstr, and understand that strings are immutable. You will use str.replace to substitute text, limit how many substitutions happen, and avoid a few common mistakes.2 min readif statements. You should also know that string methods return new strings, as covered earlier in this tutorial.2 min readfor loops, and that strings are immutable, so every method here returns a new value. Splitting turns one string into pieces. Joining builds one string from pieces.2 min readif statements. Earlier chapters covered methods that find and change text. The methods here answer a different question: what kind of characters does this string contain? Each one returns True or False and never cha2 min readreplace and strip methods from earlier chapters. By the end you will build translation tables with str.maketrans and use translate to substitute or delete characters in a single pass.2 min readstr methods return new strings, and that you have used strip, split, join, lower, and translate on their own. Here you combine them into short pipelines.2 min readstr methods from earlier chapters (find, replace, split, strip) and can read basic Python. It shows where those methods stop working and when to use the re module instead.2 min read