+ 1

Book title

file = open("/usercode/files/books.txt", "r") #your code goes here with open("/usercode/files/books.txt", "r") : print(file.read(1)+ str(len(file.readline()))) print(file.read(1)+ str(len(file.readline()))) print(file.read(1)+ str(len(file.readline()))) print(file.read(1)+ str(len(file.readline()))) file.close() I tried this code but the error is always no inputs its the code project of files

18th Sep 2021, 10:34 AM
hanane el otmani
hanane el otmani - avatar
2 ответов
+ 3
Did you think about this hanane el otmani : „Also, remember that all lines, except the last one, contain a \n at the end, which should not be included in the character count.“
18th Sep 2021, 10:49 AM
JaScript
JaScript - avatar
+ 2
Your code works. Please see here: https://code.sololearn.com/cRrlmEMKr2pG/?ref=app
18th Sep 2021, 10:46 AM
JaScript
JaScript - avatar