Loading topic
str.split when you give it an explicit separator. It assumes you can run Python code, know what strings and lists are, and can call a method and read its return value.3 min readsplit() does when you give it no argument, and how that differs from split(" ").2 min readstr.split works with a separator and with no argument, and that you are comfortable with lists, tuples and unpacking. Here you will cap the number of splits and split from the right instead of the left.3 min readstr.split works with a separator, and that you can read short Python scripts and list comprehensions. It covers str.splitlines, the method built for breaking text into lines, and how it differs from split("\n").3 min readstr.split with a separator and maxsplit. It builds on the previous chapter on maxsplit and rsplit.3 min readfor loop. Here you will learn how str.join builds one string from many.2 min readstr.join does with a list of strings.2 min readfor loops, += on strings, and the basics of str.join from the previous chapter. It explains why building a string with join is the better habit than appending to a string inside a loop.3 min readstr.split, str.join, and basic list and tuple handling. It covers when sep.join(text.split(sep)) gives back the original text, and when it does not.3 min readstr.split works, can read a simple regular expression (character classes like [,;], \s, \d, and the * and + quantifiers), and are comfortable with lists and for loops.3 min readstr.split, str.join, and basic loops and generator expressions. It shows where plain splitting gives wrong answers and how the csv module fixes them.2 min read