I've written a code that takes in a file and reads it line by line but when it prints it adds a line break in-between each line. Here's my code:
in_file = open("in.txt", "r")
line_number = 0
for line in in_file:
print "Line "+ str(line_number) + " " + "("+ str(len(line)) + " " + "chars): "+ str(line)
line_number += 1
It prints this:
Line 0 (13 chars): I am a file.
Line 1 (16 chars): This is a line.
Line 2 (22 chars): This is the last line.
How can I get rid of the breaks? Thanks!