this worked before...' '.join([`x x` for x in range(1, 6)])

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Tue May 20 02:45:20 EDT 2008


On Mon, 19 May 2008 15:28:48 -0700, notnorwegian wrote:

> ' '.join([`x  x` for x in range(1, 6)])
> 
> anyone can tell me what im doing wrong?

I doubt that this worked before because that's a syntax error:

In [84]: ' '.join([`x  x` for x in range(1, 6)])
------------------------------------------------------------
   File "<ipython console>", line 1
     ' '.join([`x  x` for x in range(1, 6)])
                   ^
<type 'exceptions.SyntaxError'>: invalid syntax

The backticks are syntactic sugar for the `repr()` function and
``repr(x x)`` isn't legal syntax either.

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list