'Print "Lexical, Syntactic" using if else statement in Python

I'm new on Python, I have problem to print "Lexical, Syntactic" in my elif statement. The result shows "Lexical" even in the str have both Lexical and Syntactic words. There's something wrong with my elif statement and already tried ways to recover it but still haven't get it right.

It only print "Lexical", should be it prints "Lexical, Syntactic" because in str there are 'and' (from syntactic) and 'reference' (from lexical)

Thank you in advance for your helps :)

lexical = [' bound ', ' break ',' call ', ' content ', ' continue ', ' contract ', ' count ', ' direct ', ' even ', ' express ', ' form ', \
          ' forward ', ' function ', ' get ', ' job ', ' level ', ' name ', ' notice ', ' number ', ' out ', ' part ', ' position ', ' record ', \
          ' reference ', ' return ', ' set ', ' source ', ' special ', ' standard ', ' string ', ' subject ', ' switch ', ' tail ', ' throw ', \
          ' translate ', ' try ', ' under ', ' value ', ' way ']

syntactic = [' and ', ' but ', ' or ', ' so ', ' because ', ' however ', ' after ', ' since ', ' during ', ' then ', ' unless ', ' that ', ' while ', \
             ' also ', ' if ', ' only if ', ' if then ', ' for ', ' just ', ' just as ', ' neither ', ' nor ', ' either ', ' not only ', ' whether ', \
             ' yet ', ' once ', ' whenever ', ' while ', ' although ', ' not only ', ' but also ', ' before ', ' as much as ', ' as soon as ', \
             ' as long as ', ' as though ', ' though ']

semantic = [' all ', ' some ', ' more ', ' a lot of ', ' enough ', ' any ', ' most ', ' lots of ', ' less ', ' many ', ' not many ', ' each ', ' a few ', \
            ' least ', ' several ', ' both ', ' fewer ', ' a little ', ' little ', ' very little ', ' a bit ', ' large amount ', ' large quantity ', ' much ', \
            ' none ', ' not any ', ' a lot of ', ' plenty of ', ' a number ', ' large number ', ' majority of ', ' great number of ']
pragmatic = [' I ', ' he ', ' she ',' it ', ' me ', ' her ', ' him ', ' them ', ' hers ', ' his ', ' its ', ' your ', ' their ', ' our ', ' herself ', ' himself ', \
             ' itself ', ' ours ', ' ourselves ', ' yourself ', ' themselves ', ' yourselves ', ' that ', ' theirs ', ' these ', ' they ', ' this ', ' which ', \
             ' who ', ' you ', ' yours ',' anyone ', ' everyone ', ' somebody ', ' anybody ', ' everybody ', ' something ', ' anything ', ' everything ']


str = "one two three four five and reference "


if any(x in str for x in lexical):
    print ("Lexical")
elif any(x in str for x in syntactic):
    print ("Syntactic")
elif any(x in str for x in semantic):
    print ("Semantic")
elif any(x in str for x in pragmatic):
    print ("Pragmatic")
elif any(x in str for x in lexical and syntactic):
    print('Lexical, Syntactic')
else:
    print ("Clean")


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source