Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
6 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
MrsTooTac:
I'm in my prime fuh all uu bum ahh ninjas omd ud83dude02ud83dude4fud83cudffe .
EdwinJsHispanic:
"poem" love is So Beautiful to have. But it's so hard to have. At this point I don't know whether its worth the wait Or if it's just millions of miles to re
EdwinJsHispanic:
"poem" love is So Beautiful to have. But it's so hard to have. At this point I don't know whether its worth the wait Or if it's just millions of miles to re
Demon25:
Yeah, I guess I'm a disappointment, doin' everythin' I can I don't wanna make you
Breathless:
I don't know if this would be considered art, but its close enough I believe, Any
Demon25:
Let my silence be my voice Let my silence remind you how many times I tried speak
EdwinJsHispanic:
How Do I make my "Happy face" look more real without people thinking something is
10 hours ago
0 Replies
0 Medals
10 hours ago
0 Replies
0 Medals
12 hours ago
0 Replies
0 Medals
2 days ago
1 Reply
0 Medals
2 days ago
3 Replies
0 Medals
4 days ago
5 Replies
1 Medal
4 days ago
13 Replies
1 Medal