anonymous
  • anonymous
Hi! Fellow OCW students! I am trying to solve problem 3 on the problem set 3. I keep getting error messages. I don't see why. Could you guys pick that out? http://pastebin.com/5DfgyJ3M Thanks!
Computer Science
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
chestercat
  • chestercat
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
What's the error messages?
rsmith6559
  • rsmith6559
MatchPair is declared as a tuple. Tuples are immutable ( can't be changed ). A list would work better.
anonymous
  • anonymous
whats the error?

Looking for something else?

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

More answers

anonymous
  • anonymous
Hi! guys. The error message is following: Traceback (most recent call last): File "", line 1, in subStringMatchOneSub("abcabcabcabcd","bc") File "/Users/piljoomoon/Documents/HW3.py", line 108, in subStringMatchOneSub filtered = constrainedMatchPair(match1,match2,len(key1)) File "/Users/piljoomoon/Documents/HW3.py", line 44, in constrainedMatchPair for second in range(0,len(secondMatch)): TypeError: object of type 'NoneType' has no len() Thank you for your help!
rsmith6559
  • rsmith6559
Sounds like secondMatch is either not declared, or it REALLY isn't what you think it is, so whatever is setting it's value isn't working properly.
anonymous
  • anonymous
hm..I am sure that secondMatch is a list. In what situation do you get this error? can you guys give me an example? : TypeError: object of type 'NoneType' has no len()
rsmith6559
  • rsmith6559
The easy way to prove it is to print secondMatch in line 43 of constrainedMatchPair. If that errors, guess what. If it doesn't, study what's printed to make sure that it's list syntax. IMO, during debugging, when in doubt, print it out.
anonymous
  • anonymous
Thanks guys for the help!

Looking for something else?

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