Typescript Count Array Python Definition