Experts Exchange connects you with the people and services you need so you can get back to work.
At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.
with open('file1.txt') as f1, open('file2.txt') as f2:
lst = [int(line) for line in itertools.chain(f1, f2)]
Open in new window
fnames = ['StudentFees1_Oct.txt', 'StudentFees2_Sept.txt']
for fname in fnames:
with open(fname) as f:
for line in f:
value = int(line) # extract the value from the line
print(value) # process the value
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.