Created
July 15, 2017 22:07
-
-
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!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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