+ 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
3 Antworten
+ 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.“
+ 2
Your code works. Please see here:
https://code.sololearn.com/cRrlmEMKr2pG/?ref=app