Could you help me in getting the mistake of my code in the Poker Hand question at the Code Coach? | Sololearn: Learn to code for FREE!
+ 1

Could you help me in getting the mistake of my code in the Poker Hand question at the Code Coach?

Dear friends, my code is working perfectly well at all cases except one hidden case. However, I couldn't get the problem. https://code.sololearn.com/cmM3nCM56BRo/#py

12th Nov 2021, 3:00 PM
Pınar Ongan
Pınar Ongan - avatar
3 ответов
0
Can you include the description as well? It seems to be a pro code coach
12th Nov 2021, 3:04 PM
Slick
Slick - avatar
+ 1
Here is the question: A hand consisting of 5 cards is given in the following format: "4S 10S 9D 2H 8D" (meaning that "4 of Spades, 10 of Spades, 9 of Diomonds, 2 of Hearts, 8 of Diamonds") Values of the cards = {2,3,4,5,6,7,8,9,10,J,Q,K,A} (in order) Suites of the cards = { H (hearts), D (diomonds), C (clubs), S (spades)} We're supposed to output the rank of the given hand in the following format "Royal Flush", "Straight", etc. Here's the grading of the cards (from lowest to highest): - High Card - One Pair - Two Pairs - Three of a Kind - Straight - Flush - Full House - Four of a Kind - Straight Flush - Royal Flush (I've inserted the meanings of them within the code) https://code.sololearn.com/cmM3nCM56BRo
12th Nov 2021, 3:22 PM
Pınar Ongan
Pınar Ongan - avatar
0
Here's what i have, my bad the code was kinda everywhere so I made this one. Check out the logic in the "has_X" methods Pınar Ongan check em out now, simplified a lot https://code.sololearn.com/cq3cKjd9ZZAs/?ref=app
12th Nov 2021, 4:55 PM
Slick
Slick - avatar