mainseq = ['hali', 'hulu', 'habi']
seq = ['a', 'b', 'c', 'd']
print('Demo of any:\n')
for each in seq:
    boolFlag = any(each in halum for halum in mainseq)
print('Any returned:{0}'.format(boolFlag))
if boolFlag:
    print(each)
print('Demo of generator as truthy value:\n')
for each in seq:
    boolFlag = (each in halum for halum in mainseq)
print('boolFlag is:{0}'.format(boolFlag))
if boolFlag:
    print(each)
print('{0} is Truthy'.format(boolFlag))
Issue with python "any" syntax