# <on_true> if <condition> else <on_false>age = 18print("1" if age > 18 else "2") # 2# <condition> and <on_true> or <on_false>msg = age > 18 and "1" or "2"print("msg = ", msg) # msg =  2# (<on_false>, <on_true>)[condition]msg = ('1', '2')[age > 18]print("msg = ", msg) # msg =  1# (lambda: <on_false>, lambda:<on_true>)[<condition>]()msg = (lambda: '11', lambda: "2")[age > 18]()print("msg = ", msg) # msg =  11# {True: <on_true>, False: <on_false>}[<condition>]msg = {True: "1", False: "2"}[age > 19]print("msg = ", msg) # msg =  2