Last active
February 18, 2016 11:48
-
-
Save saviour123/cce1a3af051b1e36dd41 to your computer and use it in GitHub Desktop.
This python script prints out all words that have no 'e' in them from the word.txt
This file contains hidden or 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
The words.txt file is located here. Thnaks so much for your help so far. | |
http://www.greenteapress.com/thinkpython/code/words.txt |
This file contains hidden or 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
def has_no_e():#not working | |
mList = open('words.txt') | |
for word in mList: | |
mList = word.strip() | |
if 'e' in word: | |
return | |
else: | |
print word | |
has_no_e() | |
##this works also | |
def has_no_e(): | |
mList = open('words.txt') | |
for word in mList: | |
item = word.strip() | |
if 'e' not in item: | |
print item | |
has_no_e() |
jeffgodwyll
commented
Feb 15, 2016
Thanks, i just try developing a new one. can give me assignment or projects to work on
Thanks, God would definitely reward you for your time.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment