[Tutor] flatten a tuple
Deirdre Saoirse
deirdre@deirdre.net
Wed, 18 Apr 2001 11:13:22 -0700 (PDT)
On Wed, 18 Apr 2001, Sean 'Shaleh' Perry wrote:
> So I have a tuple:
>
> ((0, 1, 2), (3,4,5), (6,7,8))
>
> and I want to get:
>
> (6,7,8,3,4,5,0,1,2)
>
> i.e. reverse the container, then get the contents in order.
>
> The tuple in question happens to be a 3x3, but this need not affect the answer.
Well, tuples being immutable, use an intermediary list.
I was in the middle of typing a longer answer, but Remco's clearly more
awake than I am....
--
_Deirdre NEW Stash-o-Matic: http://fuzzyorange.com http://deirdre.net
"I love deadlines. I like the whooshing sound they make as they fly by."
- Douglas Adams