0
Title Encoder - Intermediate Python
Iām having some trouble with the last Code Project for the Intermediate Python course. The only test case is hidden so I canāt see what error Iām making. How do I change the code to pass the test case? file = open("/usercode/files/books.txt", "r") for x in file: title=x.split() for a in title: print(a[0],end='') print() file.close()
2 Answers
+ 2
rl = file.readlines()
for r in rl:
sp = r.split()
p = ""
for s in sp:
p += s[0]
print(p)
+ 1
Thank you so much!