[英]Python syntax error: can't assign to operator in module but works in interpreter
I have a string a
and I would like to split it in half depending on its length, so I have 我有一个字符串
a
,我想根据它的长度将它分成两半,所以我有
a-front = len(a) / 2 + len(a) % 2
this works fine in the interpreter but when i run the module from the command line python gives me a SyntaxError: can't assign to operator
. 这在解释器中运行正常,但是当我从命令行运行模块时,python给了我一个
SyntaxError: can't assign to operator
。 What could be the issue here. 这可能是什么问题。
您可能会错误地输入连字符和下划线,请尝试
a_front = len(a) / 2 + len(a) % 2
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.