Hi,
I've a very naïve question, is there a simplier way to test a list content?b
(solution#2 does the job in a single line)
Paul
I've a very naïve question, is there a simplier way to test a list content?b
(solution#2 does the job in a single line)
Paul
MyList = ['xxXx', 'YyYy']
# solution 1
MyList_intermediate = [element.lower() for element in MyList]
Check1 = True if "zzzz" in MyList_intermediate else False
Check2 = True if "xxxx" in MyList_intermediate else False
# solution 2
Check3 = True if True in [True if ("zzzz" in elem.lower()) else False for elem in MyList ] else False
Check4 = True if True in [True if ("xxxx" in elem.lower()) else False for elem in MyList ] else False
