@staticmethod
    def strategy(opponent):

        index = next((index for index, value in enumerate(opponent.history, start=1) if value == D), None)

        if index is None:
            return C

        return random_choice(1 - 1 / float(abs(index)))
Looks at opponent history to see if they have defected.
dataset/ETHPy150Open Axelrod-Python/Axelrod/axelrod/strategies/inverse.py/Inverse.strategy