Quantcast

A community for students. Sign up today!

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Syamantak

  • one year 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
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Its Python

  2. msmithhnova
    • one year 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
    • one year ago
    Best Response
    You've already chosen the best response.
    Medals 0

    Sorry @msmithhnova the code is not working

  4. Syamantak
    • one year 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
    • one year 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

Ask a Question
Find more explanations on OpenStudy

Your question is ready. Sign up for free to start getting answers.

spraguer (Moderator)
5 → View Detailed Profile

is replying to Can someone tell me what button the professor is hitting...

23

  • Teamwork 19 Teammate
  • Problem Solving 19 Hero
  • You have blocked this person.
  • ✔ You're a fan Checking fan status...

Thanks for being so helpful in mathematics. If you are getting quality help, make sure you spread the word about OpenStudy.

This is the testimonial you wrote.
You haven't written a testimonial for Owlfred.