+ 2
Book titles question in python. Help me out to get the output
file = open("/usercode/files/books.txt", "r") #your code goes here for i in file: if i[-1]=="\n": print(i[0]+ str(len(i)-1)) else: print(i[0]+ str(len)) file.close()
4 Antworten
+ 4
https://code.sololearn.com/cW2J9gtkx4IT/?ref=app
Here in else statement...
You missed str(len(i))
+ 1
You are provided a books.txt file, which includes the book titles, each one written on a separate line.
Read the title one by one and output the code for each book on a separate line.
For example, if the books.txt file contains:
Some book
Another book
Your program should output:
S9
A12
+ 1
Ooops !!! Sometime we do shilly mistake. Btw thanks a lot
0
This is the complete question ??