jeudi 3 décembre 2020

How to make a conditional If statement that has to only meet a percentage of its conditions in Python?

Sometimes while coding apps and programs, in some situations, I would prefer if statements to work once a certain amount of conditions out of its total conditions have been met?

Such as the following:

if (a>b andor a<c andor a==d): #if only 66% of the conditions are met
    print("Conditions have been met")

If there is any information on the topic/idea your help would welcome!

Aucun commentaire:

Enregistrer un commentaire