**Create BCA.txt. Write 5 lines directly and 5 lines must be taken from user. Print the smallest and largest word in this file.
f=open("D:\23BCA286\DATA\bca.text","w")
f.write("bca is my favourite cource\
bca is a three years undergraduated cource\
this cource in this 6 semester\
this cource is designed to student carier in IT industry\
BCA stads for bachelor of computer application")
l1=[]
for i in range(5):
s=input("enter any sentence: ")
l1.append(s)
enter any sentence: bca is my favourite cource
enter any sentence: bca is a three years undergraduated cource
enter any sentence: this cource in this 6 semester
enter any sentence: this cource is designed to student carier in IT industry
enter any sentence: BCA stands for bachelor of computer application
f.writelines(l1)
f.close()
f=open("D:\23BCA286\DATA\bca.text","r")
l=f.readlines()
print(l)
['bca is my favourite cource bca is a three years undergraduated cource this cource in this 6 semester this cource is designed to student carier in IT industry BCA stads for bachelor of computer applicationbca is my favourite courcebca is a three years undergraduated courcethis cource in this 6 semesterthis cource is designed to student carier in IT industryBCA stands for bachelor of computer application']
**Create BCA.txt. Write 5 lines directly and 5 lines must be taken from user. Print the smallest and largest word in this file.
f=open("D:\23BCA286\DATA\bca.text","w")
f.write("bca is my favourite cource\ bca is a three years undergraduated cource\ this cource in this 6 semester\ this cource is designed to student carier in IT industry\ BCA stads for bachelor of computer application")
l1=[]
for i in range(5): s=input("enter any sentence: ") l1.append(s)
enter any sentence: bca is my favourite cource enter any sentence: bca is a three years undergraduated cource enter any sentence: this cource in this 6 semester enter any sentence: this cource is designed to student carier in IT industry enter any sentence: BCA stands for bachelor of computer application
f.writelines(l1)
f.close()
f=open("D:\23BCA286\DATA\bca.text","r")
l=f.readlines()
print(l)
['bca is my favourite cource bca is a three years undergraduated cource this cource in this 6 semester this cource is designed to student carier in IT industry BCA stads for bachelor of computer applicationbca is my favourite courcebca is a three years undergraduated courcethis cource in this 6 semesterthis cource is designed to student carier in IT industryBCA stands for bachelor of computer application']