You are on page 1of 1

def verifyWord(userWord, madTemplate, listOfAdjs, listOfNouns, listOfVerbs): """ userWord: a string, the word the user inputted madTemplate:

string, the type of word the user was supposed to input listOfAdjs: a list of valid adjectives listOfNouns: a list of valid nouns listOfVerbs: a list of valid verbs): returns: Boolean, whether or not the word is valid """ # Your Code Here

for s in listOfAdjs: if ((userWord==s) and (madTemplate=='[ADJ]')): return True for s in listOfNouns: if ((userWord==s) and (madTemplate=='[NOUN]')): return True for s in listOfVerbs: if ((userWord==s) and (madTemplate=='[VERB]')): return True return False

You might also like