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

 

 

 

 

 



cshell to python

Hi

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

Santosh

 




Copyright(c) 2017 - PythonBlogs.com
By using this website, you signify your acceptance of Terms and Conditions and Privacy Policy
All rights reserved