[Tutor] Is there a programmatic use for keys() and values()

Dave Angel davea at davea.name
Sun Jun 16 08:30:31 CEST 2013


On 06/16/2013 01:58 AM, Steven D'Aprano wrote:
> On 16/06/13 11:53, Dave Angel wrote:
>> On 06/15/2013 08:36 PM, Steven D'Aprano wrote:
>
>>> for key in sorted(mydict.keys()):
>>>      ...
>>>
>>> works fine.
> [...]
>> The sort() method doesn't work, but sorted does.
> [...]
>> for key in sorted(mydict.keys()):
>
> Not only that, but sorted works too:
>
> for key in sorted(mydict.keys())
>
>
> *wink*
>
>

Whoops, I guess I didn't read the whole thing.

Not only that, I didn't read all of it.

Sorry, some of it was inadequately read.

-- 
DaveA


More information about the Tutor mailing list