Questions about tuple?

Mindy csshi99 at yahoo.com
Fri Nov 8 23:30:59 EST 2002


> It's called a dictionary.
> 
> dict = {"a":1, "b":3, "l":2, "p":8, "m":(1,2,3,4,5),
> "z":"blah"}
> 
> dict.keys()
> >>> ("a", "b", "l", "p","m","z")
> 
> dict.values()
> >>> (1,3,2,8,(1,2,3,4,5),"blah")
> 
> dict["a"]
> >>>1

> dict["m"]
> >>>(1,2,3,4,5)

Thanks for your reply.
In this example, actually what I want is to get
1,2,3,4,5 seperately from (1,2,3,4,5) and put them
into five different lists, say, list1 =
[1],list2=[2],list3=[3],list4=[4],list5=[5].

Is there any simply way to "split" a tuple? Thanks!



=====
Cheers
-Mindy

__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2




More information about the Python-list mailing list