On 3/06/2006 9:47 AM, Bruno Desthuilliers wrote:

> 
> Now, given:
> 
>   bird = "parrot"
>   beautiful = "dead"
> 
> How would you do the following with f.write() ?
> 
>   print "this", bird, "is", beautiful
> 
> (without using string formating, of course...)

Like this:

f.write((' '.join(str(x) for x in ['this', bird, 'is', beautiful]) + '\n'))

... or was that a rhetorical question?

Cheers,
John
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to