How To Count Array Elements In Python For All Selected Lines