a = [1,1,1] b = a if len(a) != 0 else "123" print(b) c=[] d = c if len(c) != 0 else "123" print(d)
输出结果为:
[1,2,3] [1,2,3]