[Tutor] how i can change two lists into one directory

Luke Paireepinart rabidpoobear at gmail.com
Fri Jul 23 03:06:57 CEST 2010


Hey quit spamming the list please.

Sent from my iPhone

On Jul 22, 2010, at 7:08 PM, Alex Hall <mehgcap at gmail.com> wrote:

> On 7/22/10, ANKUR AGGARWAL <coolankur2006 at gmail.com> wrote:
>> hey i have just started making  a app using python and just gt a problem..
>> 
>> i have two list
>> a=["x","z"]
>> b=[1,2]
>> 
>> i want to make a directory like this
> It is called a dictionary, actually.
>> c={"x":1,"z":2}
>> 
>> is it possible???? i mean i tried it using loops and all but i cant append a
>> directory so i m unable to do this...
>> plz tell me if there's any way to get the directory like this.... Thanks in
>> advance :):)
> idx=0
> for i in a:
>    c[i]=b[idx]
>    idx+=1
>> 
> 
> 
> -- 
> Have a great day,
> Alex (msg sent from GMail website)
> mehgcap at gmail.com; http://www.facebook.com/mehgcap
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor


More information about the Tutor mailing list