mardi 16 juin 2015

Python AND OR statements

I am parsing text with Python and I have this final code to write sentences, but it does not work well:

if opt in ["es","la","en","ar","fr"] and extent == "begin":
    print time, opt+(" " + opt).join([c.encode('latin-1') for c in child.tail.split(' ')])

It works only with the OR statements, but when I add the AND statement (which I really need), nothing changes. Anyone please?

Aucun commentaire:

Enregistrer un commentaire