Traverse the string
for i in range ( 0 , N ) : NEW_LINE INDENT if ( s [ i ] == '0' ) : NEW_LINE INDENT sb += str ( '0' ) ; NEW_LINE DEDENT else : NEW_LINE INDENT sb += str ( '1' ) ; NEW_LINE DEDENT DEDENT bin = str ( sb ) ; NEW_LINE