I want to Split a string, reverse it and join it back with an X instead of a space in a function.
eg.
'WHO WATCHES THE WATCHERS -> to -> SEHCTAWXOHWXSREHCTAWXEHT'
str = ("WHO WATCHES THE WATCHERS")
str = str.split(' ',4)
str.reverse()
print str
str = 'X'
seq = ("who", "watches", "the", "watchers")
print str.join(seq)
But that only gets me:
['WATCHERS', 'THE', 'WATCHES', 'WHO']
whoXwatchesXtheXwatchers
when I want "SEHCTAWXOHWXSREHCTAWXEHT"
Please reply in simple function code. I'm a beginner at this.