jeudi 12 août 2021

How to use if/and?

I'm trying to use if-function with "and". It doesn't work - is there a better way or a better command? Here is an example of my code:

        if measure >= 4.52 and <= 4.58:
            optimal += measure
            total += measure
            count += 1
        elif measure >= 4.50 and <= 4.60:
            allowed += measure
            total += measure
            count += 1
        else:
            faulty += measure
            total += measure
            count += 1

Thanks for help!

Aucun commentaire:

Enregistrer un commentaire