In the context of this exercise, if you do a
join() after a
split() using the same delimiter, does this result in the original string?
Yes, this should result in the original string. This is because
split() are essentially inverses of each other.
When we split, it returns a list of substrings that the delimiter was separating. And, when we join on the same delimiter, it merely places that delimiter back where the splits were performed, resulting the same string.
original = "*A*B*C*D" splitted = original.split("*") joined = "*".join(splitted) print(joined) # *A*B*C*D