0

I want return the first letter and the total number of bytes together

Here is my code: file = open("/usercode/files/books.txt", "r") print(file.readlines()) file.close() Instead of every lines I want print only the first character and the total bytes of the lines together. Example : Instead of Harry Potter/n I want to print H12 And I want to remove the /n also.

19th Oct 2020, 2:07 AM
ASHRAFUL HAQUE SULAIMAN
ASHRAFUL HAQUE SULAIMAN - avatar
1 Resposta
0
Read the following thread and learn from their discussion 👇 https://www.sololearn.com/Discuss/2550294/?ref=app
19th Oct 2020, 3:52 AM
Ipang