MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / _compare_cards

Method _compare_cards

project_euler/problem_054/sol1.py:226–231  ·  view source on GitHub ↗
(self, other: PokerHand)

Source from the content-addressed store, hash-verified

224 return name + f", {high}"
225
226 def _compare_cards(self, other: PokerHand) -> str:
227 # Enumerate gives us the index as well as the element of a list
228 for index, card_value in enumerate(self._card_values):
229 if card_value != other._card_values[index]:
230 return "Win" if card_value > other._card_values[index] else "Loss"
231 return "Tie"
232
233 def _get_hand_type(self) -> int:
234 # Number representing the type of hand internally:

Callers 1

compare_withMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected