Here is what I tried
f = open('names.txt')
for people in f:
print('{0} and {1}'.format(people, people))
Output:
john
and john
vlad
and vlad
But my expected output is
john and john
vlad and vlad
What is wrong here and how to fix it?
Here is what I tried
f = open('names.txt')
for people in f:
print('{0} and {1}'.format(people, people))
Output:
john
and john
vlad
and vlad
But my expected output is
john and john
vlad and vlad
What is wrong here and how to fix it?