I want return the first letter and the total number of bytes together | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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
ASHRAFUL HAQUE - avatar
1 Answer
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