
![]() |
Join is the opposite of split:
>>> line1 = "iteration 12: eps= 1.245E-05" >>> line1.split() ['iteration', '12:', 'eps=', '1.245E-05'] >>> w = line1.split() >>> ' '.join(w) # join w elements with delimiter ' ' 'iteration 12: eps= 1.245E-05' |
![]() | Any delimiter text can be used:
>>> '@@@'.join(w) 'iteration@@@12:@@@eps=@@@1.245E-05' |