for loop for two lists

Hi

  I would like to make permutation of two lists in python. 

for example: 

first file  contains (file1)

1

2

3

second file contains (called file2)

a

b

c

The output of the permutation should be 

 

1 a

1 b

1 c

2 a

2 b

2 c

3 a

3 b

3c 

in python: 

 for i in file1:

     for j in file2:

         print i.rstrip(), j.rstrip 

But the output is only

1 a

1 b

1 c

Could some  suggest what I am missing, or what is other way in python to do this

 Psan

 

 

 

 

 

Comments (6) Posted to General 08/21/2010 Edit

cshell to python

Hi

Can some one give me few tips how to convert shell script to python code?

Santosh

 

Comments (2) Posted to General 08/10/2010 Edit


Around here

Categories

My Links

General

Feeds