________________________________
> Date: Wed, 18 Jun 2008 19:43:21 +0530
> From: [EMAIL PROTECTED]
> To: tutor@python.org
> Subject: [Tutor] (no subject)
>
> Hi , Could you please tell me , how i can traverse a two dimensional array , 
> i am sorry , it must be pretty simple but I am new to python am not able to 
> understand.
>
> --
> A-M-I-T S|S


Are you talking about an object which contains corresponding key value pairs? 
If so, in python it is called a dictionary and  look like this
 d = { 1 : 'a' , 2 : 'b' , 3 : 'c'}.   

I am not totally sure what you mean  by traverse. But if you are talking about 
how you access the values stored at a key, you simply do it by calling the key 
and then it returns the value like this:

       >>> d = { 1 : 'a', 2 : 'b', 3 : 'c'}         
       >>> d[1]
        'a'
       >>>


- Emil
_________________________________________________________________
News, entertainment and everything you care about at Live.com. Get it now!
http://www.live.com/getstarted.aspx
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to