Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
16 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
unknownnnnnn:
Same Year, New Lie... They dress the night in fireworks so no one has to look too closely.
penguin:
When I first met you, I felt like I had known you forever, telling you my secrets and what I didn't want ever.
Lillys2account:
This is one called "New year?" They say, u201cNew year, new me,u201d like a spell in the air, But the clock strikes twelve and Iu2019m still standing there.
uknownprttyfacekayla:
Happy new years everyone stay safe and enjoy the new year i pray that everyone ha
addison123456:
HAPPYYY BDAYYYYY @jhaseker bestie for realllllll happy 16thh
xjacob:
Your best If you always try your best Then you'll never have to wonder About what you could have done And If your best Was not good As you hoped it would be
Lillys2account:
Youu2019re not like the others, and thatu2019s what scares me most. Youu2019re the boy who listens when my thoughts trip over themselves, who doesnu2019t ro
Lillys2account:
Iu2019m a teenager in the 2020s with too many tabs open on my laptop, on my phone, in my head.
Lillys2account:
Here's something that i wrote when i felt as if i was losing my family and my old best friend.
unknownnnnnn:
Rot in Plain Sight Why is this world so sick with lies, cheating wrapped in pretty alibis? Love is used, then tossed aside, no shame, no guilt just swollen
23 minutes ago
2 Replies
1 Medal
3 hours ago
0 Replies
0 Medals
2 hours ago
6 Replies
1 Medal
1 hour ago
6 Replies
3 Medals
16 hours ago
9 Replies
0 Medals
1 day ago
4 Replies
2 Medals
9 hours ago
7 Replies
1 Medal
1 day ago
12 Replies
3 Medals
1 day ago
4 Replies
2 Medals
1 day ago
5 Replies
1 Medal