条件で文字列の比較を使用できないのはなぜですか? 私はPythonで働いています。
myjson = 辞書のリスト
if myjson[row]['languages'] == '' | myjson[row]['languages'] == 'english': pass
else: gen_dict['languages'].append(myjson[row]['languages'])
エラー:
Traceback (most recent call last):
File "/private/var/folders/jv/9_sy0bn10mbdft1bk9t14qz40000gn/T/Cleanup At Startup/gc_all_del_dup.txt-395854237.266.py", line 157, in <module>
gen_nondup(f_l)
File "/private/var/folders/jv/9_sy0bn10mbdft1bk9t14qz40000gn/T/Cleanup At Startup/gc_all_del_dup.txt-395854237.266.py", line 132, in gen_nondup
if myjson[row]['languages'] == '' | myjson[row]['languages'] == 'english': pass
TypeError: unsupported operand type(s) for |: 'str' and 'str'