anonymous
  • anonymous
In Problem Set 3, Problem 6A: I can't get the provided perm.py file to return anything no matter what I pass it. I have also tried pasting its code into my program... still nothing. It doesn't seem to populate a list. Should it return a list, 'items', 'handlist', or 'toret', because if so, none of these are coming out of it. Relevant snippets from my code: from perm import * #I have also tried copy/pasting everything from this file into my program and calling it locally get_perms(hand, letters_remaining) xuniqueCombinations(hand, letters_remaining) #before and after these calls handlist = [], toret = [], & items =[]... nothing changes. Am I broke, or might it be the perm.py file?
MIT 6.00 Intro Computer Science (OCW)
  • 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
you would need something along the lines of toret = get_perms(hand, letters_remaining) so you can store the result that is returned by the function
anonymous
  • anonymous
Oops. That was an obvious omission on my part. However, when that is included in the code, it still yields an empty list of " toret = [''] ".
anonymous
  • anonymous
I have the following to start 6A for i in range(1,HAND_SIZE+1): perm_list=get_perms(hand,i) As long as the "hand" dictionary has something in it, perm_list should contain all combinations of the letters in hand starting at size 1 up to hand_size.

Looking for something else?

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

More answers

anonymous
  • anonymous
To clarify, if hand is {'a':2,'c':2,'t':2} then on the first iteration perm_list will be ['a', 'a', 'c', 'c', 't', 't'].
anonymous
  • anonymous
Awesome. I have movement! Will give it a shot moving forward with debugging and will reply if I get stuck again. Thanks!

Looking for something else?

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