Page 84 - PYTHON-12
P. 84

count=0


               for sentence in read:

                   line=sentence.split()

                   times+=1


                   for each in line:

                       line2=each

                       times2+=1


                       if chk==line2:

                           count+=1


               print("The search String ", chk, "is present : ", count, "times")

               print(times)

               print(times2)
































               Program 15:  Write a Program to read data from data file in read mode and append the
               words starting with letter ‘T’ in a given file in python.

               Solution:
   79   80   81   82   83   84   85   86   87   88   89