vendredi 18 mars 2016

If statement with both 'and' and 'or'

I want my if statement to evaluate True if answers[3] == 'Friday' and if answers[4] equals either of '13-15' or '15-17'

Is below form correct?

if (answers[3] == 'Friday' and (answers[4] == '13-15' or answers[4] == '15-17')):

Aucun commentaire:

Enregistrer un commentaire