title: how to split the last element in the string
body: <p>I am trying to split the last element from the build_location if it is same as the previous element,however the expected ouput is not the same,can you help on how to fix it?</p>
  
  <pre><code>build_location = "\\data\builds797\PROD\client.1.8-01180-STD.PROD-1\client.1.8-01180-STD.PROD-1"
  
  buildid =build_location.split("\\")
  
  
  if buildid[-1] == buildid[-2]:
      #split the last element after "\"
      build_location = build_location.split("\\")[-1]
  print build_location
  
  OUTPUT:-
  client.1.8-01180-STD.PROD-1
  
  EXPECTED OUTPUT:-
  
  \\data\builds797\PROD\client.1.8-01180-STD.PROD-1
  </code></pre>