You can call different functions with the same arguments based on a condition: >>> (foo if cond else bar)(5,7) miro.medium.com/max/1430/1*aOi… #python_tip by @PetraVidnerova