Python String Functions Substring Cpp Brakes