Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. # Read all lines from a file that do not begin with an # and put them into a set
  2.  
  3. keywords = set()
  4. for line in open("keywords.txt"):
  5. line = line.strip()
  6. if not line.startswith("#"):
  7. keywords.add(line)
  8.  
  9. print(sorted(keywords))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement