python remove new line
line = line.strip('\n')
line = line.strip('\t')
4
2
mylist = []
# Assuming that you have loaded data into a lines variable.
for line in lines:
mylist.append(line.strip().split('\t')
Thank you!
2
0
4.22
9
a_string = a_string.rstrip("\n")
Thank you!
9
0
4.33
3
lines = ("line 1 \r\n")
lines.rstrip("\n\r")
Thank you!
3
0
Are there any code examples left?
New code examples in category Python