Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
17 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
EdwinJsHispanic:
I'm liking the wrong person more and more what do I do
Peer0Pressures0bad:
what do I do if I really like someone, but they are acting really distant?
EdwinJsHispanic:
what to do when u like someone ur not supposed to like
Redfox123:
Must a function that is decreasing over a given interval always be negative over that same interval? Explain.
Arizona:
can i get some help on this question i don't understand how to right this in first person.
thereneelg:
Im sorry. ik this isn't an educational question. but how do I stop an unhealthy obsession over someone? Like it's literally so bad.
JohnnyFowler2008:
I love music, music is one of the main things I use to cope with when I am going
10 minutes ago
0 Replies
0 Medals
10 hours ago
17 Replies
1 Medal
7 hours ago
6 Replies
0 Medals
1 day ago
1 Reply
0 Medals
3 days ago
0 Replies
0 Medals
2 days ago
4 Replies
1 Medal
2 days ago
8 Replies
2 Medals