Reverse every other word in a given string, then return the string. Throw away any leading or trailing whitespace, while ensuring there is exactly one space between each word. Punctuation marks should be treated as if they are a part of the word in this kata.
def reverse_alternate(string):
    splitted = string.split()
    converted = []
    for elt in splitted :
        if splitted.index(elt) % 2 != 0 :
            reversed = ''.join(char for char in elt[::-1])
            converted.append(reversed)
        else :
            converted.append(elt)
    return ' '.join(converted)
def reverse_alternate(string):
    splitted = string.split()
    converted = []
    for elt in splitted :
        if splitted.index(elt) % 2 != 0 :
            reversed = ''.join(char for char in elt[::-1])
            converted.append(reversed)
        else :
            converted.append(elt)
    return ' '.join(converted)