Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'print words not having any of the forbidden letters'
- def isNotForbid(word,forbidLetters):
- for letter in word:
- if letter in forbidLetters:
- return False
- return True
- fin=open("words.txt")
- forbidLetters = ("a","e","i","o","u")
- for line in fin:
- word = line.strip()
- if isNotForbid(word,forbidLetters):
- print word
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement