0
Somebady help me?
You need to make a special categorization program, which assigns each book a special code based on its title: The code is equal to the first letter of the book, followed by the number of characters in the title. For example, for the book "Harry Potter", the code would be: H12, since it contains 12 characters (including space) You are given a books.txt file, which includes the title of the book, each written on a separate line. You have to read the title one by one and draw the code for each book on a separate line. For example, if the books.txt file contains: Some book Another book Your program should generate: S9 A12
5 Answers
+ 7
Carlos Quiala , before we can help you, you should present your attempt here. if you have done no try by yourself, please do so. put your code in playground and link it here. thanks!
+ 4
Carlos Quiala - ok. can you give a description of the problem you have? thanjs!
+ 1
What do you need help with?
0
I try this:
ile = open("/usercode/files/books.txt", "r")
for line in file.readlines():
print(line[0] + str(len(line)-1))
file.close()
0
The first messages is the description