CSC 207 Fall 2011 Quiz 7
When squirrels get together for a party, they like to have acorns. A squirrel party is successful when the number of acorns is between 40 and 60, inclusive. Unless it is the weekend, in which case there is no upper bound on the number of acorns. Return True if the party with the given values is successful, or False otherwise.

Here are two possible solutions to this problem. For each one, show an example of arguments that produce an incorrect return value and clearly state what is wrong with the code

def acorn_party(acorns, is_weekend):
  return acorns >= 60 and acorns <= 40 or is_weekend

def acorn_party(acorns, is_weekend):
  if (acorns < 60):
    if (acorns > 40):
      return True
    else:
      return is_weekend

Sign in to Google to save your progress. Learn more
Name *
Answer *
Submit
Clear form
Never submit passwords through Google Forms.
This content is neither created nor endorsed by Google. Report Abuse - Terms of Service - Privacy Policy