There is such a code
x = 3 * y + z x = x if x > 0 else 0 Is it possible to somehow write it into one instruction, but avoid duplicating the calculation of x ? Those. not in this way:
x = (3 * y + z) if (3 * y + z) > 0 else 0 There is such a code
x = 3 * y + z x = x if x > 0 else 0 Is it possible to somehow write it into one instruction, but avoid duplicating the calculation of x ? Those. not in this way:
x = (3 * y + z) if (3 * y + z) > 0 else 0 Source: https://ru.stackoverflow.com/questions/561711/
All Articles