Search if a pair can be formed with arr [ i ]
temp = sum - arr [ i ] NEW_LINE if temp in mydict : NEW_LINE INDENT count = mydict [ temp ] NEW_LINE for j in range ( count ) : NEW_LINE INDENT print ( " ( " , temp , " , ▁ " , arr [ i ] , " ) " , sep = " " , end =   ' ' ) NEW_LINE DEDENT DEDENT if arr [ i ] in mydict : NEW_LINE INDENT mydict [ arr [ i ] ] += 1 NEW_LINE DEDENT else : NEW_LINE INDENT mydict [ arr [ i ] ] = 1 NEW_LINE DEDENT