def smart_capwords(s: str, sep: str=None) -> str:
    'Like string.capwords() but does not capitalize words that already\n    contain a capital letter.'
    words = s.split(sep)
    for (i, word) in enumerate(words):
        if all((x.islower() for x in word)):
            words[i] = word.capitalize()
    return (sep or ' ').join(words)
Like string.capwords() but does not capitalize words that already
contain a capital letter.
def smart_capwords(s: str, sep: str=None) -> str:
    'Like string.capwords() but does not capitalize words that already\n    contain a capital letter.'
    words = s.split(sep)
    for (i, word) in enumerate(words):
        if all((x.islower() for x in word)):
            words[i] = word.capitalize()
    return (sep or ' ').join(words)