Pyahon: List data from two lists

11 12 2013

20131211

When we want to display data from 2 lists we can do this.

a = [1,2,3,4,5]

b = [6,7,8,9,0]

if we use zip funcetion

zip(a,b)

the output is [(1,6),(2,7),(3,8),(4,9),(5,0)]

we can display in loop for

for i in zip(a,b):

     pirnt i

the output will show

(1,6)

(2,7)

(3,8)

(4,9)

(5,0)

 


Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: