Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren0
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 Antworten
+ 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.