From 42f81863d7e4c80c8100b2eca50c3a3b3e427442 Mon Sep 17 00:00:00 2001 From: Lauren Dawnkaski Date: Sat, 30 Nov 2024 01:12:21 -0500 Subject: [PATCH] Check point 1 since we are doing this with dice, I think we could also use it to simulate a deck of cards which could be useful for a game. --- dice_stats.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dice_stats.py b/dice_stats.py index 83a99cb..4f7742c 100644 --- a/dice_stats.py +++ b/dice_stats.py @@ -18,6 +18,19 @@ class FiveDice: if face != 1: return False return True + + def is_three_of_a_kind(self): + for face in self.faces(): + if self.faces().count(face) >= 3: + return True + return False + + def is_four_of_a_kind(self): + for face in self.faces(): + if self.faces().count(face) >= 4: + return True + return False + dice = FiveDice() successes = 0