【发布时间】:2026-01-12 20:45:01
【问题描述】:
我在编写 Python 代码时遇到了这个非常奇怪的错误。这是一个与不受支持的操作数类型有关的 TypeError。我得到的错误如下:
names_in_both = jsonDataprevFile.keys() & jsonDatacurrFile.keys()
TypeError: unsupported operand type(s) for &: 'list' and 'list'
【问题讨论】:
-
你想达到什么目的?
-
您是否要使这两个列表相交?或者将它们连接起来?
标签: python json list python-2.7 dictionary