0

Title Encoder Python

пишу любые решения(из инета) и постоянно ошибка. что не так? нужно сделать For example, for the book title "Game of Thrones" the encoded version should be "GoT". file = open("/usercode/files/books.txt", "r") #your code goes here file.close()

23rd Sep 2022, 5:34 PM
Polly
4 Respuestas
+ 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()
22nd Dec 2022, 5:46 AM
Juan David Ortiz Guevara
Juan David Ortiz Guevara - avatar
0
t = "Game of Thrones" for w in t.split(): print (w[0], end="")
23rd Sep 2022, 5:46 PM
SoloProg
SoloProg - avatar
0
file = open("/usercode/files/books.txt", "r") #your code goes here rl = file.readlines() for r in rl: for w in r.split(): print (w[0], end="") print() file.close() https://www.sololearn.com/compiler-playground/c7XcuKuF2B6Y
23rd Sep 2022, 6:00 PM
SoloProg
SoloProg - avatar
0
file = open("/usercode/files/books.txt", "r") #your code goes here for x in file: title=x.split() for a in title: print(a[0],end='') print() file.close()
23rd Sep 2022, 7:35 PM
ALI Moussa Kadjalla
ALI Moussa Kadjalla - avatar