Jun-13-2021, 08:27 PM
(This post was last modified: Jun-13-2021, 08:27 PM by Gribouillis.)
It seems that you inverted the condition implied by your first post! You could also try something like
>>> a1, b1 = 140.2, 6543.5 >>> silos1a = b1 - a1 - bool(b1 > a1) * 6553.5 >>> print(f'Расход: {silos1a:.1f}') Расход: -150.2This amounts to using
bool()
as a programmatic version of the Iverson bracket used by mathematicians.