Terry Carroll wrote:
> On Fri, 14 Sep 2007, Michael Langford wrote:
>
>
>> What you want is a set, not a list. Lucky for you, a python dict uses a
>> set for its keys, so cheat and use that.
>>
>
> Is that true?
>
>
>>>> d={1:"a", 2:"b"}
>>>> k=d.keys()
>>>> type(k)
>>>>
> <type 'list'>
>
He worded it incorrectly since there is actually a 'set' type, but what
he meant was that there wouldn't be multiples of each key that you add,
so you would effectively eliminate multiples and thus have a set when
you get a list of dict keys.
-Luke
_______________________________________________
Tutor maillist - [email protected]
http://mail.python.org/mailman/listinfo/tutor
- Re: [Tutor] Livewires christopher . henk
- Re: [Tutor] Livewires Tonu Mikk
- [Tutor] is this a vista issue sacha rook
- Re: [Tutor] is this a vista issue Kent Johnson
- [Tutor] list iteration question for wr... sacha rook
- [Tutor] remove blank list items sacha rook
- Re: [Tutor] remove blank list... Michael Langford
- Re: [Tutor] remove blank ... Kent Johnson
- Re: [Tutor] remove blank ... Terry Carroll
- Re: [Tutor] remove blank ... Luke Paireepinart
- Re: [Tutor] remove blank ... Michael Langford
- Re: [Tutor] remove blank ... Kent Johnson
- Re: [Tutor] is this a vista issue Rikard Bosnjakovic
- [Tutor] Livewires Seon Kang
- Re: [Tutor] Livewires bhaaluu
