we normally use the operator to add two integer or floating-point numberssuch as in the expression which evaluates to the integer value but we can also use the operator to concatenate two string valueslike the expression 'hello'world'which evaluates to the string value 'helloworldsimilarlythe operator that we normally use for division can also combine path objects and strings this is helpful for modifying path object after you've already created it with the path(function for exampleenter the following into the interactive shellfrom pathlib import path path('spam''bacon'eggswindowspath('spam/bacon/eggs'path('spam'path('bacon/eggs'windowspath('spam/bacon/eggs'path('spam'path('bacon''eggs'windowspath('spam/bacon/eggs'using the operator with path objects makes joining paths just as easy as string concatenation it' also safer than using string concatenation or the join(methodlike we do in this examplehomefolder ' :\users\alsubfolder 'spamhomefolder '\\subfolder ' :\\users\\al\\spam'\\join([homefoldersubfolder]' :\\users\\al\\spama script that uses this code isn' safebecause its backslashes would only work on windows you could add an if statement that checks sys platform (which contains string describing the computer' operating systemto decide what kind of slash to usebut applying this custom code everywhere it' needed can be inconsistent and bug-prone the pathlib module solves these problems by reusing the math division operator to join paths correctlyno matter what operating system your code is running on the following example uses this strategy to join the same paths as in the previous examplehomefolder path(' :/users/al'subfolder path('spam'homefolder subfolder windowspath(' :/users/al/spam'str(homefolder subfolder' :\\users\\al\\spamthe only thing you need to keep in mind when using the operator for joining paths is that one of the first two values must be path object