Typescript Get Last Character Of String In Python