Get keys from a dicionary

macm moura.mario at gmail.com
Fri Nov 11 11:36:55 EST 2011


On Nov 11, 2:25 pm, John Gordon <gor... at panix.com> wrote:
> In <8f5215a8-d08f-4355-a5a2-77fcaa32c... at j10g2000vbe.googlegroups.com> macm <moura.ma... at gmail.com> writes:
>
> > I pass a nested dictionary to a function.
> > def Dicty( dict[k1][k2] ):
>
> That's not valid syntax.
>
> >    print k1
> >    print k2
> > There is a fast way (trick) to get k1 and k2 as string.
>
> Are you stating this can be done, or are you asking if it can be done?
> Questions usually end with a question mark.  (Are you a native English
> speaker?)
>
> > Whithout loop all dict. Just it!
>
> print "%s" % x
>
> --
> John Gordon                   A is for Amy, who fell down the stairs
> gor... at panix.com              B is for Basil, assaulted by bears
>                                 -- Edward Gorey, "The Gashlycrumb Tinies"

Hi John

I am not a native English speaker. Sorry bad english.

Regards

macm



More information about the Python-list mailing list