I've matched strange behavior of .capitalize function with reduce.
from functools import reduce
def camel_case(string):
return reduce(lambda x,y:x.capitalize()+y.capitalize(),string.split())
and the result of camel_case('camel case word') is 'CamelcaseWord' while when I use .upper(),for example,everything works fine.
What I misunderstand? Thanks everyone for response!