0
我在阅读Learning Python by Mark Lutz。 它在Python表达式运算符书面章:TypeError:^:'list'和'list'的不受支持的操作数类型
x^y
- Bitwise XOR, set symmetric difference
brief googling后的主题是什么symmetric difference
我希望[1, 3]
从输出:
y = ['1', '2']
x = ['2', '3']
print x^y
而是我:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unsupported operand type(s) for ^: 'list' and 'list'
我没有得到什么? ^
究竟是为了什么?
将它与'set',而不是'list'一起使用... – deceze