May-23-2018, 06:06 PM
Hello, I am working on ThinkPython exercise 9.3 which asks us to write a function that determines whether any word contains a list of "forbidden letter"(fl) as a user input. I wrote the below code but can't seem to get Pyhon to recognize the "forbidden letters". Please help! Thank you.
def avoids(word): fl = raw_input('What letters you would like to forbid?\n') all_fl=fl.lower()+fl.upper() print (all_fl) for char in word: if char == all_fl: return False return True