Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Python program to combine each line from first file with the corresponding line in second file

with open('file1.txt') as f1,open('man.txt') as f2:
	for l1,l2 in zip(f1,f2):
		# print(l1+l2)
		l1=l1.strip()
		l2=l2.strip()
		print(l1+l2)
Comment

PREVIOUS NEXT
Code Example
Python :: how to print horizontally in python 
Python :: numpy declare arraylength 
Python :: question command python 
Python :: python division 
Python :: Python check if all elements exist in another list 
Python :: python rps 
Python :: how to exit program in python 
Python :: how to make variable global in python 
Python :: manage.py startapp not working in django 
Python :: list files in http directory python 
Python :: math domain error python 
Python :: get definition of word python 
Python :: remove rows from pandas 
Python :: socket exception python 
Python :: crop black border python 
Python :: tuple comprehension python 
Python :: python dict comprehension 
Python :: how to know if the space button has been clicked in python pygame 
Python :: xpath start-with python 
Python :: save object pickle python 
Python :: how to make a game in python 
Python :: dataframe to pandas 
Python :: load image metadata with pil 
Python :: how to clear dictionary in python 
Python :: fibonacci sequence in python 
Python :: how to get scrapy output file in json 
Python :: to string python 
Python :: oserror: invalid cross-device link 
Python :: password guessing game python 
Python :: numpy.random.choice 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =