title: How do I use pdfplumber to find the number of pages?
body: <p>Tried the following code</p>
  <pre><code>with pdfplumber.open(&quot;C:\Trial\Sample.pdf&quot;) as pdf:
  #Total number of pages
      totalpages = pdf.pages
      for i in enumerate(totalpages):
          pageobj = totalpages[i]
          print(pageobj.extract_text())
      #loop end
  #big loop end
  </code></pre>
  <p>I am getting the following error
  TypeError: list indices must be integers or slices, not tuple</p>