I have a list like following
mylist = [('value1', 'value2', 'value3'), ('secval1', 'secval2', 'secval3')]
how do I see if the list contains 'value2'?
Use any()
:
any('value2' in sublist for sublist in mylist)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With