#day 4

#list files of a particular directory
# import os
#
# fw=open("D:/Users/submalik/Desktop/foo/3.txt",'w')
# fw.write('new stuff\ncool stuff\ngreat!')
# fw.close()
#
# l=os.listdir("D:/Users/submalik/Desktop/foo")
# l.append('my.html')
# print(l)
#
# try:
#     for i in l:
#         fr=open('D:/Users/submalik/Desktop/foo/'+i)
#         v=fr.read()
#         w=len(v.split())
#         s=len(v.splitlines())
#         print('words in',i,'= ',w)
#         print('lines in',i,'= ',s)
#         print('avg words per line for ',i,'= ',float(w)/float(s))
#
#     fr.close()
# except IOError:
#     print('ERROR: Ooops!...the file does not exist.')
#





