[Tutor] interesting str behavior ...

lonetwin lonetwin@yahoo.com
Fri May 16 03:40:03 2003


On Friday 16 May 2003 11:52 am, Danny Yoo wrote:
>
> If we want to make temp 56 elements long, and if we want to do it by using
> append() only, we've got to do something to let us do a repeated append()
> that many times.
>
Re: And that is as easy as rearranging the contruct 

>>> temp.append([item for item in letters])

like so:

>>> junk_this = [temp.append(item) for item in letters]
>>> temp
['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 
'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 
'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 
'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
>>>

:)
Peace
Steve

-- 
A government that is big enough to give you all you want is big enough
to take it all away.
		-- Barry Goldwater