A kiosk fee can be piecewise: 10.5 per unit up to 10, then 9.0 after.
Goal
Define the fee and print f(5) and f(12).
import sympy as sp
x = sp.symbols('x', real=True)
fee = sp.Piecewise((10.5 * x, x <= 10), (10.5 * 10 + 9 * (x - 10), True))
print(fee)
print(fee.subs(x, 5), fee.subs(x, 12))import sympy as sp
x = sp.symbols('x')
print(sp.Piecewise((0, x < 0), (x, True)).subs(x, -1))import sympy as sp
x = sp.symbols('x')
print(sp.heaviside(x).subs(x, -2), sp.heaviside(x).subs(x, 2))import sympy as sp
x = sp.symbols('x', real=True)
print(sp.diff(sp.Abs(x), x))