This was what I searched on the Internet, but unfortunately I didnβt find on the Internet, but while experimenting with the Python interpreter.
>>> case = "caseCamel" >>> label = "Case Camel" >>> list = ["apple", "banana"] >>> >>> (case or label) in list False >>> list = ["apple", "caseCamel"] >>> (case or label) in list True >>> (case and label) in list False >>> list = ["case", "caseCamel", "Case Camel"] >>> (case and label) in list True >>>
and if you have a long list of variables stored in the variable sublist variable
>>> >>> list = ["case", "caseCamel", "Case Camel"] >>> label = "Case Camel" >>> case = "caseCamel" >>> >>> sublist = ["unique banana", "very unique banana"] >>> >>> # example for if any (at least one) item contained in superset (or statement) ... >>> next((True for item in sublist if next((True for x in list if x == item), False)), False) False >>> >>> sublist[0] = label >>> >>> next((True for item in sublist if next((True for x in list if x == item), False)), False) True >>> >>> # example for whether a subset (all items) contained in superset (and statement) ... >>> # a bit of demorgan law ... >>> next((False for item in sublist if item not in list), True) False >>> >>> sublist[1] = case >>> >>> next((False for item in sublist if item not in list), True) True >>> >>> next((True for item in sublist if next((True for x in list if x == item), False)), False) True >>> >>>
Emirhan Γzlen Jan 29 '19 at 6:26 2019-01-29 06:26
source share