Count Number Of Substrings In A String Python Methods