+ 1

Help please!

What am i doing wrong!? Here's my code file = open("/usercode/files/books.txt", "r") #your code goes here list = file.readlines() for i in list: print(i[0] + str(len(i))) file.close() And here's what the output should be: H12 T16 P19 G18

3rd Jul 2022, 11:52 PM
Anouar Maazaz
Anouar Maazaz - avatar
4 Antworten
3rd Jul 2022, 11:56 PM
Slick
Slick - avatar
+ 2
Include in the question description a description of the task, the problem you had and a link to your code in Code Playground. This allows us to see the problem. Also, don't use "list" as a variable. It's a reserved class name.
4th Jul 2022, 5:17 PM
Emerson Prado
Emerson Prado - avatar
0
Emerson Prado Thanks for your reply I found the solution with a help from Slick. So, thank you guys a lot 🤗
4th Jul 2022, 5:22 PM
Anouar Maazaz
Anouar Maazaz - avatar
0
Anouar Maazaz Good. Keep the reserved words hint anyway.
4th Jul 2022, 6:09 PM
Emerson Prado
Emerson Prado - avatar