>>> definitions =
{'name':'dipo','food':'spaghetti','age':30,'location':'lagos'}
>>> definitions.keys()
['food', 'age', 'name', 'location']
>>> definitions.values()
['spaghetti', 30, 'dipo', 'lagos']
>>>


You can do this to get what you want.
Hope it helps.

On Tue, Oct 25, 2011 at 2:54 PM, <bod...@googlemail.com> wrote:

> Sure,
>
> mydict = {'a':1, 'b',2}
> for key in mydict:
>    print key
>
> Hope this helps,
> Bodsda
> Sent from my BlackBerry® wireless device
>
> -----Original Message-----
> From: ADRIAN KELLY <kellyadr...@hotmail.com>
> Sender: tutor-bounces+bodsda=googlemail....@python.org
> Date: Tue, 25 Oct 2011 13:45:50
> To: <tutor@python.org>
> Subject: [Tutor] printing a key not a value
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>



-- 
Elegbede Muhammed Oladipupo
OCA
+2348077682428
+2347042171716
www.dudupay.com
Mobile Banking Solutions | Transaction Processing | Enterprise Application
Development
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to