Fix: Python style: multiple-line conditions in IFs #fix #computers #development
Fix: Python style: multiple-line conditions in IFs #fix #computersĀ #development
Python style: multiple-line conditions in IFs
Sometimes I break long conditions in IFs to several lines. The most obvious way to do this is:
if (cond1 == 'val1' and cond2 == 'val2' and cond3 == 'val3' and cond4 == 'val4'): do_something
Isnāt very very appealing visually, because the action blends with the conditions. However, it is the natural way using correct Python indentation of 4 spaces.
View On WordPress















