Python-Python错误“SyntaxWarning: “is“ with a literal. Did you mean “==“?”

Python 3.8(或更高)下:
出现报错

SyntaxWarning: "is" with a literal. Did you mean "=="?
1
解决方法:
将对应语句中is/is not用== 和 != 代替

原因:
从 python 3.8 开始,使用 is 和 is not 运算符时,会抛出 SyntaxWarning 语句警告信息