-1

I have two arrays with string values, they have similar values and different ones, how can I remove the same values from them and put the remnants in two different arrays? Example from below

one_ar = ['Python', 'Java', 'C']
two_ar = ['Python', 'Lua']

one_result = ['Java', 'C']
two_result = ['Lua']
Corrygan
  • 11
  • 1
  • 4
  • Does this answer your question? [Get only unique elements from two lists](https://stackoverflow.com/questions/28444561/get-only-unique-elements-from-two-lists) – TheFungusAmongUs May 03 '22 at 15:18

1 Answers1

-1

A simple solution would be

one_result = [x in one_ar if x not in two_ar]
two_result = [x in two_ar if x not in one_ar]

If you need it with efficient scaling to large size, you might prefer something else.