(Jan-03-2024, 02:10 PM)paul18fr Wrote: is there a simplier way to test a list content?bIt's unclear what exactly you try to check
(solution#2 does the job in a single line)
>>> spam = ['xxx', 'yyy', 'zzz'] >>> 'zzz' in spam True >>> any('zz' in item for item in spam) True >>> any('aa' in item for item in spam) False >>>
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs