Given a string, return a new string that has transformed based on the input:

* Change case of every character, ie. lower case to upper case, upper case to lower case.
* Reverse the order of words from the input.

**Note:** You will have to handle multiple spaces, and leading/trailing spaces.

For example:

```
"Example Input" ==> "iNPUT eXAMPLE"
```

You may assume the input only contain English alphabet and spaces.

Difficulty: introductory

Starter code:

def string_transformer(s):
	

Solutions:
def string_transformer(s):
    return ' '.join(s.swapcase().split(' ')[::-1])

def string_transformer(s):
    return ' ' .join(s.split(' ')[::-1]).swapcase()

def string_transformer(s):
    #1st step: split the string (done)
    x = []
    s = s.split(" ")
    for i in range(1, 2 * len(s) - 1, 2):
        s.insert(i, " ")
    print(s)
    if "" in s:
        for i in s:
            i.replace("", " ")
    print(s)
    #2nd step: reverse s (google to find the way)
    s.reverse()
    print(s)
    #3rd step: reverse the case for each string in the list (google to find the way)
    for i in s:
        for j in i:
            if j == " ":
                x.append(j)
            elif j.isupper():
                j = j.lower()
                x.append(j)
            else:
                j = j.upper()
                x.append(j)
    print(x)
    #4th step: join the list to make string
    return ''.join(x)


def string_transformer(s):
    s = s.swapcase()
    s = s.split(" ")[::-1]
    s = " ".join(s)
    return s

def string_transformer(s):
    s = s.split(" ")
    s = s[::-1]
    s = " ".join(s)
    result = ""

    for letter in s:
        if letter.islower():
            result = result + letter.upper()
        elif letter.isupper():
            result = result + letter.lower()
        else:
            result = result + letter
    
    return result

def string_transformer(s):
  return ' '.join(word.swapcase() for word in reversed(s.split(' ')))

def string_transformer(s):
    return ' '.join([i.swapcase() for i in s.split(' ')][::-1])


def string_transformer(stg):
    return " ".join(word for word in stg.swapcase().split(" ")[::-1])

def string_transformer(s):

    array = []

    if s is '':
        return ''
        
    for i in s:
        if i == i.lower():
            array.append(i.upper())
        else:
            array.append(i.lower())
            
    result = ''.join(array)
    return ' '.join(result.split(' ')[::-1])

def string_transformer(s):
    str1 = ''.join([i.upper() if i.islower() else i.lower() for i in s])
    str2 = str1.split(' ')
    str2.reverse()
    return ' '.join(str2)