s = pc.ls(orderedSelection=1) for i in range(len(s)): ____if '|' in str(s): ________s = str(s) ________continue ____temp = [str(s)] ____while pc.listRelatives(temp[0], p=1, f=1): ________temp.insert(0, str(pc.listRelatives(temp[0], p=1, f=1)[0])) ____s = '|'.join(temp) print s ug the formatting is gone. Replace underscore…