Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
7 Online
I'm working on problem set #6, the one with the scrabble-like word game. I'm trying to figure out how to define a function that will provide all the subsets (or sub-multisets) within a hand. I suspect I should be able to write a recursive function for it, but I'm stumped. Where to turn?
Still Need Help?
Join the QuestionCove community and study together with friends!
i found the itertools module in the standard library useful http://docs.python.org/library/itertools.html#itertools.permutations http://docs.python.org/library/itertools.html#itertools.combinations
Yes, I was searching for advice on permutations and found this also. It will do what I need, but it seems like it would be more beneficial to learn to you write a function myself.
nested loops? one for each character position?
Can't find your answer?
Make a FREE account and ask your own questions, OR help others and earn volunteer hours!
Join our real-time social learning platform and learn together with your friends!
Join our real-time social learning platform and learn together with your friends!
Latest Questions
Nitrox:
if i hit on every person I see on ts, what are the chances I can pull some1 ud83d
Nitrox:
how long would it take for some1 to run around the earth 25 times with a 30 sec b
urfavbrunette:
The school came into view far too quickly than I anticipated. I pulled into the parking lot, my heart racing at the thought of being really late to school.
Peer0Pressures0bad:
**"The Fear of Being Yours"** I think I'm starting to like you more than I should, More than I planned to, more than I thought I could.
thereneelg:
Alright so, I took my descriptive assessment about 2 or 3 weeks ago. My tutor on PAPER.
EdwinJsHispanic:
You forgot while I remembered And maybe its me that's short tempered It hurt like
9 hours ago
15 Replies
1 Medal
13 hours ago
18 Replies
0 Medals
1 day ago
3 Replies
0 Medals
2 days ago
8 Replies
2 Medals
2 days ago
4 Replies
0 Medals
9 hours ago
9 Replies
2 Medals