How to return a boolean for a match between two list of strings

Hello ,
I have two list of string variables
listA always contain the following values as {“055959”,“095959”,“125959”,“155959”}
and l
List B could contain anything more or less than list A {“055959”,“095959”,“125959”,“155959”,“BOY”,“CAT”,“033”}

I want a boolean to return true as long as list B has the all the contents of list A which is {“055959”,“095959”,“125959”,“155959”}

so if list B is {“055959”,“095959”,“125959”,“155959”,“BOY”,“CAT”,“033”} Boolean returns true

and if list B is {“095959”,“125959”,“155959”,“BOY”,“CAT”,“033”} Boolean returns False

and if list B is {“055959”,“095959”,“125959”,“155959”} boolean returns True

and vice versa

Thanks a lot

Hi @David_Oku,

It can be done using for loop:

  1. Loop the ListA
  2. For each Item of List A, find if it exist in List B
  3. Any failure, break the loop and your answer will be False
  4. If all passed your answer will be True.

Hope this helps

Good day!!! Happy Automation :slight_smile:


1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.