Consider using str.title().