There is a text file that I am reading from.
for line in file:
print(line, end='1')
The keyword argument '1' gets printed twice - once at the end of each line as expected but another at the beginning of the next line.
this is the output
CodePudding user response:
Your Textfile probably contains empty lines between those sentences. Those empty lines will get printed as well with a "1" at the end.