0

Error

Where is the error ? def evaluate_poker_hand(cards): card_values = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '10': 10, 'J': 11, 'Q': 12, 'K': 13, 'A': 14} # Split the input string into a list of cards card_list = cards.split() # Separate values and suits of the cards values = [card[0] for card in card_list] suits = [card[1] for card in card_list] # Count occurrences of each value and suit value_counts = {value: values.count(value) for value in values} suit_counts = {suit: suits.count(suit) for suit in set(suits)} # Sort values in ascending order sorted_values = sorted([card_values[value] for value in values]) # Check for different hand ranks if len(set(suits)) == 1 and sorted_values == list(range(min(sorted_values), max(sorted_values)+1)): return 'Straight Flush' elif len(set(values)) == 5 and sorted_values == list(range(min(sorted_values), max(sorted_values)+1)): return 'Straight' elif

7th Jan 2024, 3:32 PM
Мухаммадчон Мусаев
Мухаммадчон Мусаев - avatar
1 Antwort
+ 5
Your code is incomplete. Please save it in the code playground and provide a link. Please only tag the appropriate language (seems loke Python, not C++). Also, please describe what your program does, what inputs you are using, what is the error message you are experiencing.
7th Jan 2024, 3:41 PM
Tibor Santa
Tibor Santa - avatar