Валерия обнови решението на 29.11.2022 16:40 (преди почти 3 години)
+white_figures_dict = {'R': 5, 'N': 3, 'B': 3, 'Q': 9, 'K': 4, 'P': 1}
+black_figures_dict = {'r': 5, 'n': 3, 'b': 3, 'q': 9, 'k': 4, 'p': 1}
+
+
+class ChessException:
+    pass
+
+
+class ChessPosition(ChessException):
Вече видно от лога с тестовете, но няма логика това да наследява ChessException.
Препоръчвам да разгледаш останалите решения. Ако има нещо неясно, питай да разясним.
+
+    def __init__(self, figures):
+        self.figures = figures
+        self.white_figures = []
+        self.black_figures = []
+
+        if figures in white_figures_dict.keys():
+            self.white_figures.append(figures)
+        elif figures in black_figures_dict.keys():
+            self.black_figures.append(figures)
+
+        counter_K = 0
+        counter_k = 0
+        for white in white_figures_dict:
+            if white == 'K':
+                counter_K += 1
+
+        for black in black_figures_dict:
+            if black == 'k':
+                counter_k += 1
+
+        if counter_k > 1 or counter_K > 1:
+            raise Exception('kings')
+
+    def get_white_score(self):
+        # white_score = 0
+        # for figure in self.white_figures:
+        #     if score == 'R':
+        #        white_score += 5
+        #     elif figure in ('N', 'B'):
+        #       white_score += 3
+        #     elif figure == 'Q':
+        #        white_score += 9
+        #     elif figure == 'K':
+        #        white_score += 4
+        #     else:
+        #        white_score += 1
+        # return white_score
+
+        score = ChessScore(self.white_figures)
+        return score.int()
+
+    def get_black_score(self):
+        # black_score = 0
+        # for figure in self.black_figures:
+        #    if figure == 'r':
+        #       black_score += 5
+        #    elif figure in ('n', 'b'):
+        #       black_score += 3
+        #   elif figure == 'q':
+        #       black_score += 9
+        #   elif figure == 'k':
+        #       black_score += 4
+        #    else:
+        #       black_score += 1
+        # return black_score
+
+        score = ChessScore(self.black_figures)
+        return score.int()
+
+    def white_is_winning(self):
+        white_score = self.get_white_score()
+        black_score = self.get_black_score()
+
+        if white_score > black_score:
+            return True
+        else:
+            return False
+
+    def black_is_winning(self):
+        white_score = self.get_white_score()
+        black_score = self.get_black_score()
+
+        if black_score > white_score:
Просто return black_score > white_score
+            return True
+        else:
+            return False
+
+    def is_equal(self):
+        white_score = self.get_white_score()
+        black_score = self.get_black_score()
+
+        if white_score == black_score:
+            return True
+        else:
+            return False
+
+
+class ChessScore:
+    def __init__(self, list_figures):
+        if list_figures in (white_figures_dict.keys(), black_figures_dict.keys()):
Това няма да работи така, както очакваш. Проверяваш дали list_figures е в колекция, но колекцията ще съдържа точно два елемента - двата списъка с ключове. Реално те дори не са списъци, а dict_keys обекти. Това, което ти трябва, е по-скоро list_figures in list(white_figures_dict.keys()) +  black_figures_dict.keys())
+            self.list_figures = list_figures.lower()
+
+    def __lt__(self, other):    # a < b
+        return self.list_figures < other.list_figures
+
+    def __gt__(self, other):    # a > b
+        return self.list_figures > other.list_figures
+
+    def __le__(self, other):    # a <= b
+        return self.list_figures <= other.list_figures
+
+    def __ge__(self, other):    # a >= b
+        return self.list_figures >= other.list_figures
+
+    def __eq__(self, other):    # a == b
+        return self.list_figures == other.list_figures
+
+    def __ne__(self, other):    # a != b
+        return self.list_figures != other.list_figures
+
+    def __add__(self, other):   # a + b
+        return ChessScore(self.list_figures + other.list_figures)
+
+    def int(self):
+        sum = 0
+
+        for figure in self.list_figures:
+            if figure == 'r':
+                sum += 5
+            elif figure in ('n', 'b'):
+                sum += 3
+            elif figure == 'q':
+                sum += 9
+            elif figure == 'k':
+                sum += 4
+            else:
+                sum += 1
+        return sum

Вече видно от лога с тестовете, но няма логика това да наследява
ChessException.Препоръчвам да разгледаш останалите решения. Ако има нещо неясно, питай да разясним.
Просто
return black_score > white_scoreТова няма да работи така, както очакваш. Проверяваш дали
list_figuresе в колекция, но колекцията ще съдържа точно два елемента - двата списъка с ключове. Реално те дори не са списъци, аdict_keysобекти. Това, което ти трябва, е по-скороlist_figures in list(white_figures_dict.keys()) + black_figures_dict.keys())