- 1
On files
Pls guys I tried a code.....I wouldnt be able to post it ...but it was on files I was to pick the first letter in every line and join to the count of the words As in: F12 S11 F6 But when I did it I got stuffs like F 12 S 11 F 6 Pls can anyone help with how to remove the space in-between them so it looks like the first one . Thank you
7 odpowiedzi
+ 2
you dont print space 🤷🏻♂️ ..
or post your code ...
+ 2
Answer:
print(line[0] + len(line))
+ 1
E ~ J it there check it now
+ 1
And it actually printed it the problem is that it gave space between then eg
F 12
But I wanted it to be
F12 like this
0
Prashanth Kumar
file = open("/usercode/files/books.txt", "r")
x=file.read().splitlines()
file.seek(0)
for line in x:
print(line[0],len(line)
)
0
E ~ J sorry I don't understand you
0
Upload the code and let me put some comment and correction