Skip to content

Instantly share code, notes, and snippets.

@samjarman
Created July 15, 2017 22:07
Show Gist options
  • Save samjarman/6619647975a19fdcc89ff7f85a10ac72 to your computer and use it in GitHub Desktop.
Save samjarman/6619647975a19fdcc89ff7f85a10ac72 to your computer and use it in GitHub Desktop.
Looks at a unix systems dictionary for words starting with 'con' and adds 's' to them, making a scone pun. How sconvenient!
words = '/usr/share/dict/words'
with open(words, encoding="utf-8") as file:
my_list = file.readlines()
my_list = [x.strip() for x in my_list]
for rows in my_list:
if rows[0:3] == 'con':
print("s"+rows)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment