📅  最后修改于: 2022-03-11 14:46:22.740000             🧑  作者: Mango
# 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)