橘子味的心
标题:Python3 元组Tuple CMP 方法

Python3 元组Tuple CMP 方法

#!/usr/bin/python3

tuple1, tuple2 = (123, 'xyz'), (456, 'abc')

print cmp(tuple1, tuple2)
print cmp(tuple2, tuple1)
tuple3 = tuple2 + (786,);
print cmp(tuple2, tuple3)

目录

分类