Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
24 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
Tanasia:
I just wanna ask if you guys can help me pray for my twin she is in the hospital due to gallstones she might have to get her kindey or liver removed she is
Twaylor:
how do I make my candy harder? is it the cook time, sugar amount, water amount, o
curriful:
Is there a maximum to how many emojis you can add onto a QC group? Or is it limit
zanesafoodie:
have any of you worked with a teacher that you physically just CAN'T suck it up a
Shadow:
Hello QuestionCove Users! Today we are officially announcing two promotions to our staff, @eiwoh2 (Howie) as our new Senior Moderator, and @axie as our new
Arizona:
I'm Doing the ACT testing tomorrow which I feel like I don't even want to try but my friends are making me.
Twaylor:
NASA's Artemis II will be going around the moon today at exactly 1 pm EST (right now) https://www.
1 day ago
1 Reply
0 Medals
7 hours ago
2 Replies
0 Medals
7 hours ago
4 Replies
2 Medals
1 day ago
3 Replies
0 Medals
2 days ago
29 Replies
14 Medals
3 days ago
4 Replies
3 Medals
3 days ago
1 Reply
1 Medal