human
Given a binary string , count number of substrings that start and end with 1. | A Python3 program to count number of substrings starting and ending with 1.
Count of 1 's in input string.
Traverse input string and count of 1 's in it.
Return count of possible pairs among m 1 's.
Driver program to test above function"
Solution in Python:

=====
What is a code to given a binary string , count number of substrings that start and end with 1?
assistant
#Here is code to given a binary string , count number of substrings that start and end with 1.
 def countSubStr ( st , n ) :
	m = 0
	for i in range ( 0 , n ) :
		if ( st [ i ] == '1' ) :
			m = m + 1
	return m * ( m - 1 ) // 2
st = "00100101" ;
list ( st )
n = len ( st )
print ( countSubStr ( st , n ) , end = " " )