Say I have:
t = ( ('dog', 'Dog'), ('cat', 'Cat'), ('fish', 'Fish'), )
And I need to check if the value is in the first bit of the nested tuple (i.e. the least significant bits). How can i do this? The recorded values ββdo not matter, I want to search for a string only in lowercase.
if 'fish' in t: print "Fish in t."
Does not work.
Is there a good way to do this without doing a for loop with if statements?
Marek kalinowski
source share