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

Arnaud Delobelle arnodel at googlemail.com
Tue May 20 02:03:58 EDT 2008


John McMonagle <jmcmonagle at velseis.com.au> writes:

> notnorwegian at yahoo.se wrote:
>> ' '.join([`x  x` for x in range(1, 6)])
>> 
>> anyone can tell me what im doing wrong?
>> --
>> http://mail.python.org/mailman/listinfo/python-list
>> 
>
>
> ' '.join(['%s %s' % (str(x), str(x)) for x in range(1,6)])
>
> or
>
> ' '.join([str(x)+' '+str(x) for x in range(1,6)])
>
>
> outputs....
>
> '1 1 2 2 3 3 4 4 5 5'
>
>
> Is that what you were after ?

Or:

' '.join(str(i//2) for i in xrange(2, 13))

?

-- 
Arnaud



More information about the Python-list mailing list