mardi 22 mai 2018

Shortening conditional in Python

I am wondering what is the most succinct way of writing the following conditional?

if not 0.01 < parameters[0] <1. or not 0.01 < parameters[1] <2. or not 0.01 < parameters[2] <0.25 or not 0.01 < parameters[3] <0.25 or not 0.01 < parameters[4] < 0.2
    #do something

Aucun commentaire:

Enregistrer un commentaire