Opérateur ternaire utilisant le dictionnaire en python

# declaring python variables
num1 = 10
num2= 5
# python ternary operator using dictionary
result = {True: "num1 is larger", False: "num2 is larger"}[num1 > num2]
# printing
print(result)
Shy Skunk