a = [('Илья',), ('Машка',)]
b = "Машка"
for i in a:
if b in a:
print(True)
break
from functools import reduce
def check(txt, tup):
types = [list, set, tuple]
while tup:
if txt in tup:
return True
tup = [i for i in tup if type(i) in types]
tup = reduce(lambda x,y: list(x) + list(y), tup)
return False
a = ((1),(2, ('asd', ('qwer', 1, "Машка"))))
b = "Машка"
print(check(b, a))