Advertisement
Guest User

Untitled

a guest
May 26th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. infile = open(filename, 'r', encoding="utf-8")
  2. text = infile.read().lower().split()
  3.  
  4. list_of_words = [word.strip('n"-:';,.') for word in text]
  5.  
  6. for word in list_of_words:
  7. if word.isalpha():
  8. list_2.append(word)
  9. return list_2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement