Python Quest

Track 7 · Lesson 3 of 11

Splitting and joining text

Break delimited text into fields with split, rsplit, maxsplit and partition, and build text back up with join.

About 35 minBeginner4 exercises

You will be able to

  • Split text on whitespace or on a chosen separator and explain the difference
  • Limit the number of splits with maxsplit and split from the right with rsplit()
  • Use partition() and rpartition() to cut a string into exactly three parts
  • Join a list of values into one string, converting non-strings first

Included with a Formula Quest membership

It has 4 graded exercises with feedback, hints and solutions. Python Quest is included in Formula Quest memberships that cover Python; membership and billing are managed on Formula Quest.

View Formula Quest memberships

Tracks 1 and 2, the first lesson of every track, the playground and the dataset library are free.