+ 1
how can I count the characters in each line without the /n
file = open("/usercode/files/books.txt", "r") file.close()
3 Réponses
+ 2
You can also print a line except the last line without last character.
str(len(line)-1))
+ 1
until know I dont take the function strip in the course
0
You can use strip() function.