There’s an issue with the print_results function in robot_race_functions.py that prevents the final score from being printed out. The error is stated that there is a TypeError: ‘<’ between instances of ‘Counter’ and ‘Counter’. Anyone know anything about how to solve it? I’ve posted a screenshot of the error down below
The problem is most likely with the arguments provided to the print_results function. It looks like you provided instances of Counter rather than the values needed. Consider the following:
>>> class Num:
... def __init__(self, value):
... self.value = value
...
>>> a = Num(4)
>>> b = Num(5)
>>> a < b
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'Num' and 'Num'
#the same error was thrown because the instances themselves cannot be compared with '<'
#the values stored in the `value` property of each instance can be compared
>>> a.value < b.value
True