In [1]:
abbr = 'NLP'
full_text = 'Natural Language Processing'
# Enter your code here:
In [6]:
%%writefile contacts.txt
First_Name Last_Name, Title, Extension, Email
In [3]:
# Write your code here:
# Run fields to see the contents of contacts.txt:
fields
Out[3]:
In [4]:
# Perform import
# Open the file as a binary object
# Use PyPDF2 to read the text of the file
# Get the text from page 2 (CHALLENGE: Do this in one step!)
page_two_text =
# Close the file
# Print the contents of page_two_text
print(page_two_text)
In [5]:
# Simple Solution:
In [7]:
# CHALLENGE Solution (re-run the %%writefile cell above to obtain an unmodified contacts.txt file):
In [8]:
import re
# Enter your regex pattern here. This may take several tries!
pattern =
re.findall(pattern, page_two_text)
Out[8]: