Write a program in python3.
If your
input:
I am a Student of Nalanda Institute of technology.And I am a Good boy.
Output:
I am a of technology.And am a boy.
Means your First word should be available in out put but starting a word from capital letter(
Student) should not be show in your output.But after full stop First word must be in your output.
But you have to read the text from a text file.
What I have tried:
import os
os.chdir("C:/Users/Biswajit Sahu/Desktop/Tickets/")
file = open('bisu.txt','r')
lines = file.readlines()
for line in lines:
print(line)
list_1 = []
list_2 = []
list_1 = line.split()
for i in list_1:
if i.istitle():
pass
else:
list_2.append(i)
result = ' '.join(list_2)
print('*'*120)
print(result)
f.close()
My text file input
I biswajit Babuni sahu. I ramchandra Sahu pradhan.
************************************************************************************************************************
output
biswajit sahu. ramchandra pradhan.