0
help with Book title
file = open("/usercode/files/books.txt", "r") cont = file.readlines() for i in cont: print(f'{i[0]}{len(i)-1}') file.close()
1 Antwort
+ 6
I did in a different way
file = open("/usercode/files/books.txt", "r")
for line in file:
if line[-1] == '\n':
print(line[0] + str(len(line) -1))
else:
print(line[0] + str(len(line)))
#your code goes here
file.close()