0
39 code project (Python)
Hi, Iâve already written the code and it works but the test says me itâs wrong. Can someone help me??
7 RĂ©ponses
+ 2
Your code?
+ 2
file = open("/usercode/files/books.txt", "r")
for line in file.readlines():
g=line.split(" ")
e=""
for o in g:
e+=o[0]
print(e)
file.close()
+ 2
Your code is missing two inputs.
https://code.sololearn.com/cZrx4H2mo27S/?ref=app
+ 1
https://code.sololearn.com/cNEHV3jR2m5F/?ref=app
+ 1
file = open("/usercode/files/books.txt", "r")
for line in file:
words = line.split()
i = ""
for word in words:
i += word[0]
print(i)
file.close()
0
Itâs working, thank you so much.
But, why my code doesnât work?
0
Perfect, thank you so much.