If current number does not exceed N
if int ( l [ i ] + temp2 [ j ] ) > int ( N ) : NEW_LINE INDENT flag = 1 NEW_LINE break NEW_LINE DEDENT total . append ( l [ i ] + temp2 [ j ] ) NEW_LINE temp3 . append ( l [ i ] + temp2 [ j ] ) NEW_LINE if flag == 1 : NEW_LINE break NEW_LINE if flag == 1 : NEW_LINE break NEW_LINE l = deepcopy ( temp3 ) NEW_LINE temp3 = [ ] NEW_LINE