0
Books title
Was stuck in exception handling on python 3 The projects name book title. Anyone know how to do it?
11 Answers
+ 3
Where's your code..
+ 3
Bro check this out...
https://code.sololearn.com/cpLd69M99SJy/?ref=app
Happy Coding...
+ 3
https://code.sololearn.com/c5LfMwEmIx2v/?ref=app
compare your code with this oneđđ»
+ 1
trying to print string chac and count the length of the content so that able print out as per sample output
+ 1
This is a possible solution for this problem
with open("/usercode/files/books.txt", "r") as file:
lista = [x.strip() for x in file.readlines()]
for element in lista:
print('{}{}'.format(element[0], len(element)), sep='\n')
0
given
file = open(â/usercode/files/books.txtâ , ârâ)
f = file.read()
print(file.read())
title = âstr()â+ len()
print(title)
file.close()
0
sample output should be like read txt file content and print out like below
âHarry Potterâ
output: H12
0
thank so much
0
the code is somewhat fixed there. not that really good
0
file = open("/usercode/files/books.txt", "r")
#your code goes here
books=file.readlines()
for i in books:
if i==books[-1]:
value=len(i)
else:
value=len(i)-1
print(i[0]+str(value))
file.close()
0
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()