#NEWLINE# def strategy( self , opponent ) : #NEWLINE# #INDENT# if ( not opponent . history ) : #NEWLINE# #INDENT# return C #NEWLINE# #UNINDENT# if ( self . history [ ( - 1 ) ] == D ) : #NEWLINE# #INDENT# return D #NEWLINE# #UNINDENT# p = self . _cooperation_probability ( ) #NEWLINE# return random_choice ( p )