update python and second c++ trial of length-of-last-word