[Tutor] [Q] list and loop

karthik Guru karthikg@aztec.soft.net
Sun, 7 Oct 2001 09:25:52 +0530


try this,

map(None,list1,list2)

karthik

-----Original Message-----
From: tutor-admin@python.org [mailto:tutor-admin@python.org]On Behalf Of
Young-Jin Lee
Sent: Tuesday, November 27, 2001 9:02 AM
To: tutor@python.org
Subject: [Tutor] [Q] list and loop


Hi, I'd like to how to effectively create a list out of two lists.
I have two lists, list1 = [ 1, 2, 3, 4, 5, .... 10] and list = [ 10, 20, 30,
40, .., 100]. I want to create another list out of these two lists such that
list3 = [ (1,10), (2,20), (3,30), ..., (10, 100)].
I think there must be an elegant way in python using for loop, but I
couldn't figure it out.
Thanks in advance.

YJ


_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor