I want to check the length of a list within a tuple, but I am having trouble doing this within a conditional statement.
If I have a tuple that looks like this:
ex_tuple = (['Hello', 'To', 'World'], ['Planet', 'Earth'], ['World', 'Of', 'Earth'])
I want to check if any of these lists in the tuple have > 2 elements.
Here's what I have (doesn't seem to be working):
if [(len(x)) for x in ex_tuple > 2]:
... do rest of program
But, I get an error message that '>' is not supported between tuple and ints. I've also tried using '!= 1 or 2', but I get a similar message.
This seems like a simple fix, but I am having trouble figuring out where I am going wrong. Would appreciate any help - thanks!