请将以下代码修改为三元操作符实现:
x, y, z = 6, 5, 4
if x < y:
small = x
if z < small:
small = z
elif y < z:
small = y
else:
small = z
答案:small = x if (x < y and x < z) else y if y < x and y < z else z
请将以下代码修改为三元操作符实现:
x, y, z = 6, 5, 4
if x < y:
small = x
if z < small:
small = z
elif y < z:
small = y
else:
small = z
答案:small = x if (x < y and x < z) else y if y < x and y < z else z