Function that returns true if s contains three consecutive 1 's
def check ( s ) : NEW_LINE INDENT n = len ( s ) ; NEW_LINE for i in range ( 2 , n ) : NEW_LINE INDENT if ( s [ i ] == '1' and s [ i - 1 ] == '1' and s [ i - 2 ] == '1' ) : NEW_LINE INDENT return 1 ; NEW_LINE DEDENT DEDENT DEDENT