Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
19 Online
could someone help me with:a function askForcard() which takes a card and a hand and return a tuple where first part of the tuple is a Boolean value if the cardvalue is found in the hand. For example, if we are asking our opponent for a ‘J’ and the opponents hand is [('H', 'A'), ('D', 'J')] we are retuned tuple where first part is a boolean value indicating if the card is present and second part returns the position of the card in the opponents hand, if the card is not there just return 0 for position.
Still Need Help?
Join the QuestionCove community and study together with friends!
check out: http://www.greenteapress.com/thinkpython/thinkCSpy/html/chap15.html it implements a card game (old maid) while teaching about classes (chapter 16 too).... it might give you some ideas.
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
zanesafoodie:
hidden and out of sight wayward onwards into the night silks and ribbons gizmos and gadgets forests and hatchets keep it on the down low you don't have time
zanesafoodie:
hidden and out of sight wayward onwards into the night silks and ribbons gizmos and gadgets forests and hatchets keep it on the down low you don't have time
mcglones29:
If I had known if I had seen the signs I would have spent a little more time with
jhaseker:
Once was here now is gone I will always love forever the laughs the tears the smi
zanesafoodie:
my life feels like a photograph that's all I seem to be looking at the photograph is rough at the edges~ I cant even start to understand this feeling~ I'm h
IzzyCookie:
I have a question for all the small artists here. I've been doing commissions, but the people I'm doing the commissions for are rushing me.
emmamyersglazer:
The shadow of the frost creeps in, Across the threshold, cold and thin. A knock upon a wooden door, Where warmth and safety lived before.
6 minutes ago
8 Replies
0 Medals
7 hours ago
0 Replies
0 Medals
1 day ago
0 Replies
0 Medals
1 day ago
3 Replies
0 Medals
1 day ago
6 Replies
0 Medals
1 day ago
2 Replies
0 Medals
7 hours ago
6 Replies
1 Medal