Quantcast

Got Homework?

Connect with other students for help. It's a free community.

  • across
    MIT Grad Student
    Online now
  • laura*
    Helped 1,000 students
    Online now
  • Hero
    College Math Guru
    Online now

Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

Syamantak

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

  • one year ago
  • one year ago

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

    Its Python

    • one year ago
  2. msmithhnova
    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

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

    Sorry @msmithhnova the code is not working

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

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

    • one year ago
  5. msmithhnova
    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

    • one year ago
    • Attachments:

See more questions >>>

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.