Ask
your own question, for FREE!
MIT 6.00 Intro Computer Science (OCW)
25 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
MAGABACK:
Would any of you be willing to do a March Madness bracket challenge this year, an
gr3ve3:
This is my fanfiction for Panic! At the disco, I'm not too sure if this is a good layout for chapter one.
MaxTon:
Here's my poem and I guess It could be considered a song. It's called "Time Zones" Ainu2019t got my phone on me but itu2019s not like it matters Honestly ou
EdwinJsHispanic:
tear after tear, with my eyes still red People are fake, just like him Im sorry for Yelling, but i havent heard an apology from you either.
xXAikoXx:
Today, I wrote a poem. Itu2019s regarding my struggles and how I try to escape both physically and emotionally harmful situations caused by both people and
Twaylor:
Had a surreal dream - wanted to share it I got stabbed in my middle back in my gr
JusJeyk:
@ultrilliam while the login system is great. I think QuestionCove could benefit from the option of enabling 2FA on your account.
EdwinJsHispanic:
'"dissect my insecurities i'm a defect, surgical project. if im pretty. will you
MAGABACK:
I'm not exactly sure what to put this under, but what do you guys think of my sweatshirt design? I used AI for it, but It was for a class that uses AI a lot
1 hour ago
1 Reply
0 Medals
1 day ago
1 Reply
1 Medal
1 day ago
8 Replies
2 Medals
17 hours ago
8 Replies
6 Medals
1 day ago
3 Replies
3 Medals
2 days ago
2 Replies
0 Medals
2 days ago
28 Replies
15 Medals
2 days ago
3 Replies
1 Medal
3 days ago
8 Replies
2 Medals