title: in python, write a function called wordendwithS() , to count the number of words ending with 's' from the TEXT FILE "file.txt"
body: <p>I have already tried</p>
  
  <pre><code>def wordendwithS():
  
      f=open("file.txt",'r')
  
      a=f.readlines() 
      c=0
      for i in a: 
  
          if i.endswith('s'):
              c=c+1
  </code></pre>
  
  <p>I dont know what to do please help</p>
  
  <p>What is wrong in this?</p>