Driver Code
if __name__ == ' _ _ main _ _ ' : NEW_LINE INDENT s = [ ] NEW_LINE s . append ( 4 ) NEW_LINE s . append ( 5 ) NEW_LINE s . append ( - 2 ) NEW_LINE s . append ( - 3 ) NEW_LINE s . append ( 11 ) NEW_LINE s . append ( 10 ) NEW_LINE s . append ( 5 ) NEW_LINE s . append ( 6 ) NEW_LINE s . append ( 20 ) NEW_LINE if ( pairWiseConsecutive ( s ) ) : NEW_LINE INDENT print ( " Yes " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " No " ) NEW_LINE DEDENT print ( " Stack ▁ content ▁ ( from ▁ top ) " , " after ▁ function ▁ call " ) NEW_LINE while ( len ( s ) != 0 ) : NEW_LINE INDENT print ( s [ - 1 ] , end = " ▁ " ) NEW_LINE s . pop ( ) NEW_LINE DEDENT DEDENT