Create a function that takes an input String and returns a String, where all the uppercase words of the input String are in front and all the lowercase words at the end.
The order of the uppercase and lowercase words should be the order in which they occur.

If a word starts with a number or special character, skip the word and leave it out of the result. 

Input String will not be empty.

For an input String: "hey You, Sort me Already!" 
the function should return: "You, Sort Already! hey me"

Difficulty: introductory

Starter code:

def capitals_first(text):
	

Solutions:
def capitals_first(string):
    return ' '.join([word for word in string.split() if word[0].isupper()] + [word for word in string.split() if word[0].islower()])


def capitals_first(string):
    # biggies first...
    words = string.split()
    st1 = []
    st2 = []
    for word in words:
        if word[0].isalpha():
            if word[0].isupper():
                st1.append(word)
            else:
                st2.append(word)
    return " ".join(st1 + st2)

def capitals_first(string):
    return ' '.join(sorted((a for a in string.split() if a[0].isalpha()),
                           key=lambda b: b[0].islower()))


def capitals_first(text):
    words = [ w for w in text.split() if w[0].isalpha() and not w.isnumeric() ]
    return ' '.join(sorted(words,key=lambda w: w[0] != w[0].upper()))

capitals_first=lambda t:(lambda x:' '.join([e for e in x if e[0].isupper()]+[e for e in x if e[0].islower()]))(t.split())

def capitals_first(text):
  return ' '.join(sorted(filter(lambda w: w[0].isalpha(), text.split()), key=lambda w: w[0].islower()))

def capitals_first(text):
    # one-line
    #return " ".join(sorted((word for word in text.split(" ") if word[0].isalpha()), key=lambda word: word[0].islower()))
    upper, lower = [], []
    for word in text.split(" "):
        if word[0].islower():
            lower.append(word)
        elif word[0].isupper():
            upper.append(word)
    return " ".join(upper + lower)

def capitals_first(text):
    words = text.split()
    lower,upper = [],[]
    for w in words:
        if w[0].islower(): lower.append(w)
        elif w[0].isupper(): upper.append(w)
    return " ".join(upper+lower)

from itertools import chain
def capitals_first(text):
    cap, low = [], []
    for w in text.split():
        if w[0].isalpha():
            (cap, low)[w[0].islower()].append(w)
    return ' '.join(chain(cap, low))

def capitals_first(text):
    words = [word for word in text.split() if word[0].isalpha()]
    return ' '.join(sorted(words, key=lambda x: not x[0].isupper()))