How can i retrieve a key from a dictionary?

Prabhu Ramachandran prabhu at
Sun Nov 4 11:50:39 CET 2001

>>>>> "HJ" == Husam <h.jehadalwan at> writes:

    HJ> how can one retrieve or select a key from a dictionary?
    HJ> dict={} dict[1]='one' dict[2]='two'

    HJ> dict.keys() will gets all the keys. but, i need to select
    HJ> explicitly one key for printing along its value.

Try this:



More information about the Python-list mailing list