generate functionTue, 07 Feb 2023

The department has 3 employees who receive wages in rubles. It is required to determine how much the salary of the highest paid of them differs from the lowest paid. Note: the min and max functions, as well as sorting, cannot be used, we are studying the conditional operator)

def max_min(a, b, c): if a > b and a > c: if b > c: print(a - c) else: print(a - b) elif b > a and b > c: if a > c: print(b - c) else: print(b - a) elif c > a and c > b: if a > b: print(c - b) else: print(c - a) max_min(1, 2, 3)

Questions about programming?Chat with your personal AI assistant