Python syntax error: can't assign to operator in module but works in interpreter

Posted by mzee on Stack Overflow See other posts from Stack Overflow or by mzee
Published on 2010-04-23T09:52:12Z Indexed on 2010/04/23 10:13 UTC
Read the original article Hit count: 127

Filed under:

I have a string a and I would like to split it in half depending on its length, so I have

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. What could be the issue here.

© Stack Overflow or respective owner

Related posts about python