Professional Documents
Culture Documents
Practical 12
Practical 12
Ques. Write a pyhton program to find out the size of the files in bytes, number
of lines and number of words .
f=open('new.txt','r')
str=f.read()
size=len(str)
f.seek(0)
L=f.readlines ()
b=[]
for i in L:
a =i.split()
b+=a
f.close()
OUTPUT -
Size of the file in bytes : 192
Number of lines : 8
Number of words : 37
➢ New.txt