Page 85 - PYTHON-12
P. 85

#Program to read data from data file in read mode and


               #append the words starting with letter ‘T’

               #in a given file in python

               f=open("test.txt",'r')


               read=f.readlines()

               f.close()

               id=[]


               for ln in read:

                   if ln.startswith("T"):


                       id.append(ln)

               print(id)
   80   81   82   83   84   85   86   87   88   89   90