input: Write a python function to extract text from each page of a PDF file using PyPDF2.
  assert extract_text_from_pdf('sample.pdf') == ["First page text...", "Second page text...", "Third page text..."]
  assert extract_text_from_pdf('example.pdf') == ["Page 1 text...", "Page 2 text...", "Page 3 text...", "Page 4 text..."]
  assert extract_text_from_pdf('test.pdf') == ["Test page 1...", "Test page 2..."]
output: def extract_text_from_pdf(pdf_path):
      import PyPDF2
      with open(pdf_path, 'rb') as file:
          reader = PyPDF2.PdfFileReader(file)
          text_by_page = []
          for page_num in range(reader.numPages):
              page = reader.getPage(page_num)
              text_by_page.append(page.extractText())
      return text_by_page