title: Print sentences from text file that starts and ends with particular words or character?
body: <p>How to find sentences in text file that starts and ends with particular words for example sentences that starts with 'The' and ends with 'u'.I have tried</p>
  
  <pre><code>def main():
    f=open('D:\\file.txt')
    print 'The lines that starts with The and Ends with u'
    for line in f:
       for j in line.split('.'):
           if j[0]=='T' and j[1]=='h' and j[2]=='e' and j[3]==' ' and  j[-1]=='u':
              print j
  if __name__ == '__main__':main()
  </code></pre>
  
  <p>Instead of character comparison can we do this using word comparison?</p>