I try to check all values from a dictionary with multiple criteria. With this code there is no probleme for check if all values are equal to 1 for exemple :
config = {"a": 1, "b": 1, "c": 1, "d": 3, "e": 2}
if all(value == 1 for value in config.values()):
print('correct')
else:
print('wrong')
But now if want to add some operator in this code to check if all values are 1 Or 2 Or 3 for example results aren't working like i want :
config = {"a": 1, "b": 1, "c": 1, "d": 3, "e": 5}
if all(value == (1 or 2 or 3) for value in config.values()):
print('correct')
else:
print('wrong')
>>>correct
I've also try many variations like :
if all(value == 1 or 2 or 3 for value in config.values()):
if all((value == 1 or 2 or 3) for value in config.values()):
if all(value for value in config.values() == 1 or 2 or 3):
...
So how to use correctly these operators to make this work please ?