>>> list1 = [11, 12, 13]
>>> list2 = [21, 22, 23]
>>> list1 > list2
False
>>> list1 = [31, 12, 13]
>>> list1 > list2
True
>>> list1 = [12, 13, 14]
>>> list2 = [12, 13, 14]
>>> list1 >= list2
True
>>> list1 <= list2
True
>>> list1 = [12, 13]
>>> list1 >= list2
False
>>> list1 <= list2
True
>>> list1 = [11, 12, 13]
>>> list2 = [21, 22, 23]
>>> list1 == list2
False
>>> list1 = [21, 12, 13]
>>> list1 ==list2
False
>>> list1 = [21, 22, 23]
>>> list1 == list2
True
>>>
>>> list1 = ["虎斑猫", "折耳猫", "田园猫", "布偶猫"]
>>> list2 = ["燕尾服猫", "暹罗猫"]
>>> list3 = list1 + list2
>>> list3
['虎斑猫', '折耳猫', '田园猫', '布偶猫', '燕尾服猫', '暹罗猫']
>>> list1 += list2
>>> list1
['虎斑猫', '折耳猫', '田园猫', '布偶猫', '燕尾服猫', '暹罗猫']
(python将字符串视作一种interable类型,字符串里每个元素是它的元素)
>>> list1 = ["燕尾服猫", "暹罗猫"]
>>> list1 += 123
Traceback (most recent call last):
File "", line 1, in
list1 += 123
TypeError: 'int' object is not iterable
>>> list1 += 'A'
>>> list1
['燕尾服猫', '暹罗猫', 'A']
>>> list1 += '布偶猫'
>>> list1
['燕尾服猫', '暹罗猫', 'A', '布', '偶', '猫']
>>> list1 = ["燕尾服猫", "暹罗猫"]
>>> list1 *= 3
>>> list1
['燕尾服猫', '暹罗猫', '燕尾服猫', '暹罗猫', '燕尾服猫', '暹罗猫']