我正在编写一些代码,我需要比较一些值。关键是所有变量都不应该具有相同的值。例如:
a=1 b=2 c=3 if a != b and b != c and a != c: #do something
现在,很容易看到在具有更多变量的代码的情况下,该if语句变得很长且充满ands。有没有一种简短的方法来告诉Python,没有2个变量值应该相同。
if
and
python duplicates
duplicates ×1
python ×1