Splitting Text up in python?
<p>Basically i need to write code relating to Pseudo-cryptography, in which I am given a message/text and i need to encrypt it. The process includes:</p>

<ol>
<li>Replacing the spaces between words with an “X”.</li>
<li>Reversing the text.</li>
<li>Padding out the beginning and end of the text with Xs so that the total number of       characters is a multiple of four </li>
<li>Splitting the text up into blocks of four characters.</li>
</ol>

<p>I have been able to successfully write working code to do the first 3 steps. (See at bottom of question) but i <strong>CANNOT</strong> and am in dire HELP with the last step. So for example if im given this text: 'heyhowareyou' I need the last step to return: 'heyh owar eyou'. So it needs to be split up all in the same string. Could Anyone please <strong>help</strong> me with this? Thank you soo MUCH!!</p>

<p><strong>Code written so far, that evaluates the first 3 steps:</strong></p>

<pre><code># Defining function to encrypt the message.
def encrypt(string, block_size):

    # Padding the begining and end of the text with 'X'.
    string_list = list(string)
    string_list.insert(0, 'X')
    string_list.append('X')
    string_list = ''.join(string_list)

    # Reversing the string.
    string_reversed = string_list[::-1]

    # Replacing any spaces with 'X'.
    string_reversed = string_reversed.replace(' ', 'X')
</code></pre>

<p><strong>Attempt at writing code for fourth step:</strong></p>

<pre><code>    for index in range(len(string)):
        string_list_1 = list(string_reversed)
        string_list_1.insert(4, ' ')
        string_list_1 = ''.join(string_list_1)

    return string_list_
</code></pre>
