can't assign to literal

Lie Lie.1296 at gmail.com
Wed Jun 11 14:14:35 CEST 2008


On Jun 11, 3:32 pm, MRAB <goo... at mrabarnett.plus.com> wrote:
> On Jun 10, 10:57 pm, "Steven Clark" <steven.p.cl... at gmail.com> wrote:
>
> > > for 1 in oids, vals head_oids:
> > > SyntaxError: can't assign to literal
> > > --
>
> > 1 is a literal, you can't assign it to something. Are you trying to
> > use it as a variable name?
>
> Slightly OT, but is there an editor that can display digits in a
> different colour to letters?

Most programmer oriented editors could, some even have full syntax
coloring, they would color keywords (like def, class, etc), literals
(1, 'hello', etc), and commonly used built-in function (int, ord,
iter, etc). It really helped if you have to read/write lots of codes



More information about the Python-list mailing list