human
Check if decimal representation of Binary String is divisible by 9 or not | Function to convert the binary string into octal representation.
Stores binary representation of the decimal value [ 0 - 7 ].
Stores the decimal values of binary strings [ 0 - 7 ].
Stores length of S.
Update S.
Update S.
Update N.
Stores octal representation of the binary string.
Traverse the binary string.
Stores 3 consecutive characters of the binary string.
Append octal representation of temp.
Function to check if binary string is divisible by 9 or not.
Stores octal representation of S.
Stores sum of elements present at odd positions of oct.
Stores sum of elements present at odd positions of oct.
Stores length of oct.
Traverse the string oct.
Update oddSum.
Traverse the string oct.
Update evenSum.
Stores cotal representation of 9.
If absolute value of ( oddSum - evenSum ) is divisible by Oct_9.
Driver Code"
Solution in Python:

=====
What is a code to check if decimal representation of Binary String is divisible by 9 or not and the other steps required?
assistant
#Here is code to check if decimal representation of Binary String is divisible by 9 or not and the other steps required.
 def ConvertequivalentBase8 ( S ) :
	mp = { }
	mp [ "000" ] = '0'
	mp [ "001" ] = '1'
	mp [ "010" ] = '2'
	mp [ "011" ] = '3'
	mp [ "100" ] = '4'
	mp [ "101" ] = '5'
	mp [ "110" ] = '6'
	mp [ "111" ] = '7'
	N = len ( S )
	if ( N % 3 == 2 ) :
		S = "0" + S
	elif ( N % 3 == 1 ) :
		S = "00" + S
	N = len ( S )
	octal = " "
	for i in range ( 0 , N , 3 ) :
		temp = S [ i : i + 3 ]
		if temp in mp :
		octal += ( mp [ temp ] )
	return octal
def binString_div_9 ( S , N ) :
	octal = ConvertequivalentBase8 ( S )
	oddSum = 0
	evenSum = 0
	M = len ( octal )
	for i in range ( 0 , M , 2 ) :
		oddSum += ord ( octal [ i ] ) - ord ( '0' )
	for i in range ( 1 , M , 2 ) :
		evenSum += ord ( octal [ i ] ) - ord ( '0' )
	Oct_9 = 11
	if ( abs ( oddSum - evenSum ) % Oct_9 == 0 ) :
		return " Yes "
	return " No "
if __name__ == " _ _ main _ _ " :
	S = "1010001"
	N = len ( S )
	print ( binString_div_9 ( S , N ) )