Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Syamantak

  • 3 years ago

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 """ if userword is in listofAdjs,listofNouns,listof or listofVerbs then True else False

  • This Question is Closed
  1. Syamantak
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Its Python

  2. msmithhnova
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 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 """ if madTemplate == '[ADJ]': if userWord in listOfAdjs: return True return False if madTemplate == '[NOUN]': if userWord in listOfNouns: return True return False if madTemplate == '[VERB]': if userWord in listOfVerbs: return True return False

  3. Syamantak
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Sorry @msmithhnova the code is not working

  4. Syamantak
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    I think there is an error in the code you posted @msmithhnova

  5. msmithhnova
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 1

    It seems to work here http://ideone.com/v7ujDx and this has the same code essentially http://pastebin.com/N4XBpkE3

  6. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy