Advertisement
Guest User

Untitled

a guest
Sep 26th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def sort(fn):
  2.     txt = get_txt(fn)
  3.     word_list = []
  4.     symbols = "!@#-$%^&*()\"_<>?,.[]{}`~'"
  5.  
  6.     for word in txt.split():
  7.         clear_word = ""
  8.         if word.isalpha():
  9.             clear_word += word.lower()
  10.         if clear_word not in symbols:
  11.             word_list.append(clear_word)
  12.  
  13.     return word_list
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement