stra = 'This is stirng' revword = stra.split() revword.reverse() revword=''.join(revword) print revword