I am trying to write a function where if there's a punctuation before an alphabetical character, the function will put a space before and if the punctuation is after an alphabetical character there should be a space after it. However it should not happen so in the case of integers. Eg

```
("thanks." >>> "thanks ." and "hello?123!lom" >>> "hello ?123! lom")

```

My following code works fine when there is one punctuation but not when the same punctuation repeats itself see my code below:

```
def normalize(utterance):

    # Converting to lowercase & removing multiple white spaces
    utterance = ' '.join(utterance.lower().split())

#     List of punctuations
    punctuations_list = [',','.','?',':',';','!',')','(','\'']

    for punctuation in punctuations_list:
        if punctuation in utterance:
            try: 
                char_before = str(utterance[utterance.index(punctuation) -1]) 
                char_after = str(utterance[utterance.index(punctuation) +1])
            except IndexError:
                char_after = "0"

            if char_before.isdigit()==False and char_before not in punctuations_list: 
                utterance = utterance.replace(punctuation, " " + punctuation)
            if char_after.isdigit()==False and char_after not in punctuations_list:
                utterance = utterance.replace(punctuation, punctuation + " ")

    return utterance

normalize("thank you:? the time is 2:30pm")
>>>'thank you :?  the time is 2 :30pm'

```

The output I want is:

```
 'thank you :?  the time is 2:30pm'

```

i.e. without the space between time, the issue is because of the colon ":" being repeated I believe, can someone fix this?.

The error seems to be in the below line:

```
utterance = utterance.replace(punctuation, " " + punctuation)

```

which replaces the whole punctuation wherever it matches, however I don't know how to rectify in this regard!