def capwords(s, sep=None):
 return (sep or ' ').join((x.capitalize() for x in s.split(sep)))

def capwords ( s , sep = None ) : return ( sep or ' ' ) . join ( ( x . capitalize ( ) for x in s . split ( sep ) ) )
capwords -> string split the argument into words using split .