1 # encoding: utf-8 2 3 a = 89 4 b = 89 5 # 输出唯一标识 6 print(id(a),id(b)) 7 # 对比唯一标识 8 print(a is b) 9 a = 89 10 b = 98 11 print(id(a),id(b)) 12 print(a is b) 13 a = b 14 print(id(a),id(b)) 15 print(a is b) 16 17 a = [1] 18 b = [1] 19 print(id(a),id(b)) 20 print(a is b) 21 a = b 22 print(id(a),id(b)) 23 print(a is b) 24 25 # 链状比较运算符 26 print(1 < 2 < 3) 27 print(2 < 1 < 3)