Say I have a couple of text files, fruit.txt
and veg.txt
which look like,
Apple
Pear
Orange
Brocolli
Cucumber
Spinach
I have a couple of for loops that print out the contents of the .txt files,
for line in fruit:
fields = line.split("\n")
col = fields[0]
print(col)
for line in veg:
fields = line.split("\n")
col1 = fields[0]
print(col1)
And the output I get is,
Apple
Pear
Orange
Brocolli
Cucumber
Spinach
I want to try and print it side by side like,
Apple Brocolli
Pear Cucumber
Orange Spinach